text stringlengths 4 6.14k |
|---|
/**
******************************************************************************
* @addtogroup UAVObjects OpenPilot UAVObjects
* @{
* @addtogroup BaroSensor BaroSensor
* @brief The raw data from the barometric sensor with pressure, temperature and altitude estimate.
*
* Autogenerated files and functions for BaroSensor Object
* @{
*
* @file barosensor.c
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010-2013.
* @brief Implementation of the BaroSensor object. This file has been
* automatically generated by the UAVObjectGenerator.
*
* @note Object definition file: barosensor.xml.
* This is an automatically generated file.
* DO NOT modify manually.
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* 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 3 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
*/
#include <openpilot.h>
#include "barosensor.h"
// Private variables
#if (defined(__MACH__) && defined(__APPLE__))
static UAVObjHandle handle __attribute__((section("__DATA,_uavo_handles")));
#else
static UAVObjHandle handle __attribute__((section("_uavo_handles")));
#endif
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t BaroSensorInitialize(void)
{
// Compile time assertion that the BaroSensorDataPacked and BaroSensorData structs
// have the same size (though instances of BaroSensorData
// should be placed in memory by the linker/compiler on a 4 byte alignment).
PIOS_STATIC_ASSERT(sizeof(BaroSensorDataPacked) == sizeof(BaroSensorData));
// Don't set the handle to null if already registered
if (UAVObjGetByID(BAROSENSOR_OBJID)) {
return -2;
}
// Register object with the object manager
handle = UAVObjRegister(BAROSENSOR_OBJID,
BAROSENSOR_ISSINGLEINST, BAROSENSOR_ISSETTINGS, BAROSENSOR_ISPRIORITY, BAROSENSOR_NUMBYTES, &BaroSensorSetDefaults);
// Done
return handle ? 0 : -1;
}
/**
* Initialize object fields and metadata with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
void BaroSensorSetDefaults(UAVObjHandle obj, uint16_t instId)
{
BaroSensorData data;
// Initialize object fields to their default values
UAVObjGetInstanceData(obj, instId, &data);
memset(&data, 0, sizeof(BaroSensorData));
UAVObjSetInstanceData(obj, instId, &data);
// Initialize object metadata to their default values
if ( instId == 0 ) {
UAVObjMetadata metadata;
metadata.flags =
ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UPDATEMODE_PERIODIC << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UPDATEMODE_MANUAL << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT |
UPDATEMODE_MANUAL << UAVOBJ_LOGGING_UPDATE_MODE_SHIFT;
metadata.telemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
UAVObjSetMetadata(obj, &metadata);
}
}
/**
* Get object handle
*/
UAVObjHandle BaroSensorHandle()
{
return handle;
}
/**
* Get/Set object Functions
*/
void BaroSensorAltitudeSet(float *NewAltitude)
{
UAVObjSetDataField(BaroSensorHandle(), (void *)NewAltitude, offsetof(BaroSensorData, Altitude), sizeof(float));
}
void BaroSensorAltitudeGet(float *NewAltitude)
{
UAVObjGetDataField(BaroSensorHandle(), (void *)NewAltitude, offsetof(BaroSensorData, Altitude), sizeof(float));
}
void BaroSensorTemperatureSet(float *NewTemperature)
{
UAVObjSetDataField(BaroSensorHandle(), (void *)NewTemperature, offsetof(BaroSensorData, Temperature), sizeof(float));
}
void BaroSensorTemperatureGet(float *NewTemperature)
{
UAVObjGetDataField(BaroSensorHandle(), (void *)NewTemperature, offsetof(BaroSensorData, Temperature), sizeof(float));
}
void BaroSensorPressureSet(float *NewPressure)
{
UAVObjSetDataField(BaroSensorHandle(), (void *)NewPressure, offsetof(BaroSensorData, Pressure), sizeof(float));
}
void BaroSensorPressureGet(float *NewPressure)
{
UAVObjGetDataField(BaroSensorHandle(), (void *)NewPressure, offsetof(BaroSensorData, Pressure), sizeof(float));
}
/**
* @}
*/
|
/* Copyright (C) 1995-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, August 1995.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/shm.h>
#include <ipc_priv.h>
#include <stdlib.h> /* for definition of NULL */
#include <sysdep.h>
#include <sys/syscall.h>
/* Return an identifier for an shared memory segment of at least size SIZE
which is associated with KEY. */
int
shmget (key_t key, size_t size, int shmflg)
{
return INLINE_SYSCALL (ipc, 5, IPCOP_shmget, key, size, shmflg, NULL);
}
|
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
*/
#pragma once
#include <wtf/java/JavaRef.h>
#include <wtf/Vector.h>
namespace WebCore {
class ContextMenuItem;
class ContextMenuController;
class IntPoint;
class ContextMenuJava {
private:
JGObject m_contextMenu;
public:
ContextMenuJava(const Vector<ContextMenuItem>&);
void show(ContextMenuController*, jobject page, const IntPoint& loc) const;
};
} // namespace WebCore
|
/*
* freerainbowtables is a project for generating, distributing, and using
* perfect rainbow tables
*
* Copyright Bitweasil
* Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
* Copyright 2009, 2010, 2011 James Nobis <quel@quelrod.net>
*
* This file is part of freerainbowtables.
*
* freerainbowtables 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.
*
* freerainbowtables 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 freerainbowtables. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _FAST_MD4_H
#define _FAST_MD4_H
#include "global.h"
#define MD4_DIGEST_LENGTH 16
//Main function
void MD4_NEW( unsigned char * buf, int len, unsigned char * pDigest);
#endif /* !_FAST_MD4_H */
|
/*
* Flare
* --------------
* Copyright (C) 2008-2014 GREE, 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
* 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.
*/
/**
* op_node_role.h
*
* @author Masaki Fujimoto <fujimoto@php.net>
*
* $Id$
*/
#ifndef OP_NODE_ROLE_H
#define OP_NODE_ROLE_H
#include "op.h"
#include "cluster.h"
using namespace std;
namespace gree {
namespace flare {
/**
* opcode class (node_role)
*/
class op_node_role : public op {
protected:
cluster* _cluster;
string _node_server_name;
int _node_server_port;
cluster::role _node_role;
int _node_balance;
int _node_partition;
public:
op_node_role(shared_connection c, cluster* cl);
virtual ~op_node_role();
virtual int run_client(string node_server_name, int node_server_port, cluster::role node_role, int node_balance, int node_partition);
protected:
virtual int _parse_text_server_parameters();
virtual int _run_server();
virtual int _run_client(string node_server_name, int node_server_port, cluster::role node_role, int node_balance, int node_partition);
virtual int _parse_text_client_parameters();
};
} // namespace flare
} // namespace gree
#endif // OP_NODE_ROLE_H
// vim: foldmethod=marker tabstop=2 shiftwidth=2 autoindent
|
/*
Copyright 2007-2011 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or 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.
THIS 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.
*/
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include "lilv/lilv.h"
#include "lilv-config.h"
void
list_plugins(const LilvPlugins* list, bool show_names)
{
LILV_FOREACH(plugins, i, list) {
const LilvPlugin* p = lilv_plugins_get(list, i);
if (show_names) {
LilvNode* n = lilv_plugin_get_name(p);
printf("%s\n", lilv_node_as_string(n));
lilv_node_free(n);
} else {
printf("%s\n", lilv_node_as_uri(lilv_plugin_get_uri(p)));
}
}
}
void
print_version(void)
{
printf(
"lv2_list (lilv) " LILV_VERSION "\n"
"Copyright 2007-2011 David Robillard <http://drobilla.net>\n"
"License: <http://www.opensource.org/licenses/isc-license>\n"
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.\n");
}
void
print_usage(void)
{
printf("Usage: lv2_list [OPTIONS]\n");
printf("List all installed LV2 plugins.\n");
printf("\n");
printf(" -n, --names Show names instead of URIs\n");
printf(" --help Display this help and exit\n");
printf(" --version Output version information and exit\n");
printf("\n");
printf("The environment variable LV2_PATH can be used to control where\n");
printf("this (and all other lilv based LV2 hosts) will search for plugins.\n");
}
int
main(int argc, char** argv)
{
bool show_names = false;
for (int i = 1; i < argc; ++i) {
if (!strcmp(argv[i], "--names") || !strcmp(argv[i], "-n")) {
show_names = true;
} else if (!strcmp(argv[i], "--version")) {
print_version();
return 0;
} else if (!strcmp(argv[i], "--help")) {
print_usage();
return 0;
} else {
print_usage();
return 1;
}
}
LilvWorld* world = lilv_world_new();
lilv_world_load_all(world);
const LilvPlugins* plugins = lilv_world_get_all_plugins(world);
list_plugins(plugins, show_names);
lilv_world_free(world);
return 0;
}
|
#include "platform.h"
char *hook_raw_image_addr() {return (char*) 0x420B7FC0;} //Found @0xffae0ef4 a810
char *hook_alt_raw_image_addr() {return (char*) 0x420B7FC0;} //Found @0xffae0ef4 a810
void *vid_get_viewport_live_fb()
{
void **fb=(void **)0x2274;
unsigned char buff = *((unsigned char*)0x2094);
if (buff == 0) {
buff = 2;
}
else {
buff--;
}
return fb[buff];
}
/*
* Note copied from SX110 IS
* GetBatteryTemperature usually will get back temperature of battery compartment/batteries. GetBatteryTemperature is implemented in Canon's firmware for SX120IS.
* Firmware entry point is identified (0xFFC394D8) but function is not usable. Camera will crash if Canon's GetBatteryTemperature is called by CHDK.
* To avoid a crash Canon's GetBatteryTemperature must not called. As long CHDK general code do not distinguish between cameras that support or don't support GetBatteryTemperature,
* this function will be implemented as specific CHDK-code. It returns always with -99 (which means -99° Celsius or -146° Fahrenheit).
* Original entry point in Canon's firmware is disabled (in stubs_entry.S).
* */
int _GetBatteryTemperature() { return -99;}
/*Auto generated for a810*/
void *vid_get_bitmap_fb() { return (void*)0x40411000; } // Found @0xff8521ac
void *vid_get_viewport_fb() { return (void*)0x40566b80; } // Found @0xffade168
void *vid_get_viewport_fb_d() { return (void*)(*(int*)(0x2950+0x54)); } // Found @0xff867ad4 & 0xff867b0c
char *camera_jpeg_count_str() { return (char*)0x000b3b6c; } // Found @0xff9c9264
long hook_raw_size() { return 0x01794300; } // Found @0xffae0f9c
int get_flash_params_count(void) { return 0xa6; } // Found @0xff985670
|
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2011-2016 ArkCORE <http://www.arkania.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LFGGROUPDATA_H
#define _LFGGROUPDATA_H
#include "LFG.h"
namespace lfg
{
enum LfgGroupEnum
{
LFG_GROUP_MAX_KICKS = 3
};
/**
Stores all lfg data needed about a group.
*/
class LfgGroupData
{
public:
LfgGroupData();
~LfgGroupData();
bool IsLfgGroup();
// General
void SetState(LfgState state);
void RestoreState();
void AddPlayer(uint64 guid);
uint8 RemovePlayer(uint64 guid);
void RemoveAllPlayers();
void SetLeader(uint64 guid);
// Dungeon
void SetDungeon(uint32 dungeon);
// VoteKick
void DecreaseKicksLeft();
// General
LfgState GetState() const;
LfgState GetOldState() const;
LfgGuidSet const& GetPlayers() const;
uint8 GetPlayerCount() const;
uint64 GetLeader() const;
// Dungeon
uint32 GetDungeon(bool asId = true) const;
// VoteKick
uint8 GetKicksLeft() const;
private:
// General
LfgState m_State; ///< State if group in LFG
LfgState m_OldState; ///< Old State
uint64 m_Leader; ///< Leader GUID
LfgGuidSet m_Players; ///< Players in group
// Dungeon
uint32 m_Dungeon; ///< Dungeon entry
// Vote Kick
uint8 m_KicksLeft; ///< Number of kicks left
};
} // namespace lfg
#endif
|
/*
* window-content: A content to share texture of a window
*
* Copyright 2012-2021 Stephan Haller <nomad@froevel.de>
*
* 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 __LIBXFDASHBOARD_WINDOW_CONTENT__
#define __LIBXFDASHBOARD_WINDOW_CONTENT__
#if !defined(__LIBXFDASHBOARD_H_INSIDE__) && !defined(LIBXFDASHBOARD_COMPILATION)
#error "Only <libxfdashboard/libxfdashboard.h> can be included directly."
#endif
#include <libxfdashboard/window-tracker-window.h>
G_BEGIN_DECLS
#define XFDASHBOARD_TYPE_WINDOW_CONTENT (xfdashboard_window_content_get_type())
#define XFDASHBOARD_WINDOW_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XFDASHBOARD_TYPE_WINDOW_CONTENT, XfdashboardWindowContent))
#define XFDASHBOARD_IS_WINDOW_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XFDASHBOARD_TYPE_WINDOW_CONTENT))
#define XFDASHBOARD_WINDOW_CONTENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XFDASHBOARD_TYPE_WINDOW_CONTENT, XfdashboardWindowContentClass))
#define XFDASHBOARD_IS_WINDOW_CONTENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), XFDASHBOARD_TYPE_WINDOW_CONTENT))
#define XFDASHBOARD_WINDOW_CONTENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XFDASHBOARD_TYPE_WINDOW_CONTENT, XfdashboardWindowContentClass))
typedef struct _XfdashboardWindowContent XfdashboardWindowContent;
typedef struct _XfdashboardWindowContentClass XfdashboardWindowContentClass;
typedef struct _XfdashboardWindowContentPrivate XfdashboardWindowContentPrivate;
struct _XfdashboardWindowContent
{
/*< private >*/
/* Parent instance */
GObject parent_instance;
/* Private structure */
XfdashboardWindowContentPrivate *priv;
};
struct _XfdashboardWindowContentClass
{
/*< private >*/
/* Parent class */
GObjectClass parent_class;
/*< public >*/
/* Virtual functions */
};
/* Public API */
GType xfdashboard_window_content_get_type(void) G_GNUC_CONST;
G_END_DECLS
#endif
|
#pragma once
struct CurlResponse {
char * mem;
};
signed
pb_progress_cb (void *, curl_off_t, curl_off_t, curl_off_t, curl_off_t);
size_t
pb_write_cb (char *, size_t, size_t, void *);
// vim: set ts=4 sw=4 et:
|
/* Emacs style mode select -*- C++ -*-
*-----------------------------------------------------------------------------
*
*
* PrBoom: a Doom port merged with LxDoom and LSDLDoom
* based on BOOM, a modified and improved DOOM engine
* Copyright (C) 1999 by
* id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
* Copyright (C) 1999-2000 by
* Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
* Copyright 2005, 2006 by
* Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
*
* 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.
*
* DESCRIPTION:
* Map functions
*
*-----------------------------------------------------------------------------*/
#ifndef __P_MAP__
#define __P_MAP__
#include "r_defs.h"
#include "d_player.h"
#define USERANGE (64*FRACUNIT)
#define MELEERANGE (64*FRACUNIT)
#define MISSILERANGE (32*64*FRACUNIT)
// MAXRADIUS is for precalculated sector block boxes the spider demon
// is larger, but we do not have any moving sectors nearby
#define MAXRADIUS (32*FRACUNIT)
// killough 3/15/98: add fourth argument to P_TryMove
boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean dropoff);
// killough 8/9/98: extra argument for telefragging
boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y,boolean boss);
void P_SlideMove(mobj_t *mo);
boolean P_CheckSight(mobj_t *t1, mobj_t *t2);
void P_UseLines(player_t *player);
// killough 8/2/98: add 'mask' argument to prevent friends autoaiming at others
fixed_t P_AimLineAttack(mobj_t *t1,angle_t angle,fixed_t distance, uint_64_t mask);
void P_LineAttack(mobj_t *t1, angle_t angle, fixed_t distance,
fixed_t slope, int damage );
void P_RadiusAttack(mobj_t *spot, mobj_t *source, int damage);
boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y);
//jff 3/19/98 P_CheckSector(): new routine to replace P_ChangeSector()
boolean P_ChangeSector(sector_t* sector,boolean crunch);
boolean P_CheckSector(sector_t *sector, boolean crunch);
void P_DelSeclist(msecnode_t*); // phares 3/16/98
void P_CreateSecNodeList(mobj_t*,fixed_t,fixed_t); // phares 3/14/98
boolean Check_Sides(mobj_t *, int, int); // phares
int P_GetMoveFactor(mobj_t *mo, int *friction); // killough 8/28/98
int P_GetFriction(const mobj_t *mo, int *factor); // killough 8/28/98
void P_ApplyTorque(mobj_t *mo); // killough 9/12/98
/* cphipps 2004/08/30 */
void P_MapStart(void);
void P_MapEnd(void);
// If "floatok" true, move would be ok if within "tmfloorz - tmceilingz".
extern boolean floatok;
extern boolean felldown; // killough 11/98: indicates object pushed off ledge
extern fixed_t tmfloorz;
extern fixed_t tmceilingz;
extern line_t *ceilingline;
extern line_t *floorline; // killough 8/23/98
extern mobj_t *linetarget; // who got hit (or NULL)
extern msecnode_t *sector_list; // phares 3/16/98
extern fixed_t tmbbox[4]; // phares 3/20/98
extern line_t *blockline; // killough 8/11/98
#endif // __P_MAP__
|
/*
* Unit tests for libkvkontakte.
* Copyright (C) 2015 Alexander Potashev <aspotashev@gmail.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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef TEST_NOTES_H
#define TEST_NOTES_H
#include "vktestbase.h"
#include <QtCore/QObject>
#include <QtCore/QVector>
/*
* What is tested here:
* class NotesListJob
* class AllNotesListJob
* class NoteAddJob - tested in initTestCase()
* class NoteJob
*/
class TestNotes : public VkTestBase
{
Q_OBJECT
public:
TestNotes();
private Q_SLOTS:
void initTestCase();
void testNotesListJob();
void testAllNotesListJob();
void testNoteJob();
private:
QVector<int> m_noteIds;
};
#endif // TEST_NOTES_H
|
/*
* Wavelet sharpen GIMP plugin
*
* interface.c
* Copyright 2008 by Marco Rossini
*
* 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.
*/
#include "plugin.h"
#include "interface.h"
gboolean
user_interface (GimpDrawable * drawable)
{
gboolean run;
gimp_ui_init (_("Wavelet sharpen"), FALSE);
/* prepare the preview */
preview = gimp_drawable_preview_new (drawable, &settings.show_preview);
g_signal_connect_swapped (preview, "invalidated", G_CALLBACK (sharpen),
drawable);
gtk_widget_show (preview);
/* prepare the amount/radius vbox */
amount_vbox = gtk_vbox_new (FALSE, 5);
gtk_widget_show (amount_vbox);
amount_hbox[0] = gtk_hbox_new (FALSE, 10);
amount_label[0] = gtk_label_new (_("Amount"));
gtk_misc_set_alignment (GTK_MISC (amount_label[0]), 0.0, 0.0);
amount_adj[0] =
gtk_adjustment_new (settings.sharpen_amount, 0, 10, 0.1, 0.1, 0);
amount_spin[0] =
gtk_spin_button_new (GTK_ADJUSTMENT (amount_adj[0]), 0.1, 1);
amount_scale[0] = gtk_hscale_new (GTK_ADJUSTMENT (amount_adj[0]));
gtk_scale_set_draw_value (GTK_SCALE (amount_scale[0]), FALSE);
gtk_box_pack_start (GTK_BOX (amount_vbox), amount_hbox[0], FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (amount_hbox[0]), amount_label[0], FALSE, FALSE,
0);
gtk_box_pack_start (GTK_BOX (amount_hbox[0]), amount_scale[0], TRUE, TRUE,
0);
gtk_box_pack_start (GTK_BOX (amount_hbox[0]), amount_spin[0], FALSE, FALSE,
0);
g_signal_connect_swapped (amount_adj[0], "value_changed",
G_CALLBACK (gimp_preview_invalidate), preview);
g_signal_connect (amount_adj[0], "value_changed", G_CALLBACK (set_amount),
NULL);
gtk_widget_show (amount_scale[0]);
gtk_widget_show (amount_spin[0]);
gtk_widget_show (amount_label[0]);
gtk_widget_set_tooltip_text (amount_label[0], TT_AMOUNT);
gtk_widget_set_tooltip_text (amount_scale[0], TT_AMOUNT);
gtk_widget_set_tooltip_text (amount_spin[0], TT_AMOUNT);
gtk_widget_show (amount_hbox[0]);
amount_hbox[1] = gtk_hbox_new (FALSE, 10);
amount_label[1] = gtk_label_new (_("Radius"));
gtk_misc_set_alignment (GTK_MISC (amount_label[1]), 0.0, 0.0);
amount_adj[1] =
gtk_adjustment_new (settings.sharpen_radius, 0, 2, 0.01, 0.01, 0);
amount_spin[1] =
gtk_spin_button_new (GTK_ADJUSTMENT (amount_adj[1]), 0.01, 2);
amount_scale[1] = gtk_hscale_new (GTK_ADJUSTMENT (amount_adj[1]));
gtk_scale_set_draw_value (GTK_SCALE (amount_scale[1]), FALSE);
gtk_box_pack_start (GTK_BOX (amount_vbox), amount_hbox[1], FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (amount_hbox[1]), amount_label[1], FALSE, FALSE,
0);
gtk_box_pack_start (GTK_BOX (amount_hbox[1]), amount_scale[1], TRUE, TRUE,
0);
gtk_box_pack_start (GTK_BOX (amount_hbox[1]), amount_spin[1], FALSE, FALSE,
0);
g_signal_connect_swapped (amount_adj[1], "value_changed",
G_CALLBACK (gimp_preview_invalidate), preview);
g_signal_connect (amount_adj[1], "value_changed", G_CALLBACK (set_radius),
NULL);
gtk_widget_show (amount_scale[1]);
gtk_widget_show (amount_spin[1]);
gtk_widget_show (amount_label[1]);
gtk_widget_set_tooltip_text (amount_label[1], TT_RADIUS);
gtk_widget_set_tooltip_text (amount_scale[1], TT_RADIUS);
gtk_widget_set_tooltip_text (amount_spin[1], TT_RADIUS);
gtk_widget_show (amount_hbox[1]);
/* prepare luminance select */
if (channels > 2)
{
lum_toggle = gtk_check_button_new_with_label (_("Sharpen luminance only"));
if (settings.luminance_only == TRUE)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lum_toggle), 1);
else
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lum_toggle), 0);
g_signal_connect (lum_toggle, "toggled",
G_CALLBACK (set_ycbcr_mode), NULL);
g_signal_connect_swapped (lum_toggle, "toggled",
G_CALLBACK (gimp_preview_invalidate),
preview);
gtk_widget_set_tooltip_text (lum_toggle, TT_LUMINANCE);
gtk_widget_show (lum_toggle);
}
else
{
lum_toggle = NULL;
}
/* prepare the reset buttons */
button_hbox = gtk_hbox_new (FALSE, 10);
reset_button = gtk_button_new_from_stock (GIMP_STOCK_RESET);
g_signal_connect (reset_button, "clicked", G_CALLBACK (reset_channel),
NULL);
if (lum_toggle)
gtk_box_pack_start (GTK_BOX (button_hbox), lum_toggle, TRUE, TRUE, 0);
gtk_widget_set_tooltip_text (reset_button, TT_RESET);
gtk_box_pack_start (GTK_BOX (button_hbox), reset_button, FALSE, FALSE, 0);
gtk_widget_show (reset_button);
gtk_widget_show (button_hbox);
/* prepeare the dialog */
dialog_vbox = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (dialog_vbox), 10);
dialog = gimp_dialog_new (_("Wavelet sharpen"), "wavelet sharpen", NULL, 0,
gimp_standard_help_func,
"plug-in-wavelet-sharpen", GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL, GTK_STOCK_OK,
GTK_RESPONSE_OK, NULL);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog_vbox);
gtk_box_pack_start (GTK_BOX (dialog_vbox), preview, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (dialog_vbox), amount_vbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (dialog_vbox), button_hbox, FALSE, FALSE, 0);
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
if (settings.winxsize > 0 && settings.winysize > 0)
gtk_window_resize (GTK_WINDOW (dialog), settings.winxsize,
settings.winysize);
gtk_widget_show (dialog_vbox);
gtk_widget_show (dialog);
run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK);
gtk_window_get_size (GTK_WINDOW (dialog), &(settings.winxsize),
&(settings.winysize));
/* FIXME: destroy all widgets - memory leak! */
gtk_widget_destroy (dialog);
return run;
}
|
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/syscalls.h>
int
_DEFUN(ftruncate,(fd,len),
int fd _AND
off_t len)
{
struct _reent *r = _REENT;
if(__syscalls.ftruncate_r)
return __syscalls.ftruncate_r(r,fd,len);
r->_errno = ENOSYS;
return -1;
}
|
/*
* Shell Internal Information
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id: internal.h,v 1.7 2009/06/12 01:53:33 ccj Exp $
*/
#ifndef _RTEMS_SHELL_INTERNAL_H
#define _RTEMS_SHELL_INTERNAL_H
struct rtems_shell_topic_tt;
typedef struct rtems_shell_topic_tt rtems_shell_topic_t;
struct rtems_shell_topic_tt {
const char *topic;
rtems_shell_topic_t *next;
};
extern rtems_shell_cmd_t * rtems_shell_first_cmd;
extern rtems_shell_topic_t * rtems_shell_first_topic;
rtems_shell_topic_t * rtems_shell_lookup_topic(const char *topic);
void rtems_shell_register_monitor_commands(void);
void rtems_shell_initialize_command_set(void);
void rtems_shell_print_heap_info(
const char *c,
Heap_Information *h
);
#endif
|
/**
* MaNGOS is a full featured server for World of Warcraft, supporting
* the following clients: 1.12.x, 2.4.3, 3.3.5a, 4.3.4a and 5.4.8
*
* Copyright (C) 2005-2019 MaNGOS project <https://getmangos.eu>
*
* 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
*
* World of Warcraft, and all World of Warcraft or Warcraft art, images,
* and lore are copyrighted by Blizzard Entertainment, Inc.
*/
/// \addtogroup mangosd
/// @{
/// \file
#ifndef MANGOS_H_RATHREAD
#define MANGOS_H_RATHREAD
#include <ace/SOCK_Acceptor.h>
#include <ace/Acceptor.h>
#include <ace/Task.h>
#include <ace/INET_Addr.h>
#include "Common.h"
class RASocket;
class ACE_Reactor;
typedef ACE_Acceptor < RASocket, ACE_SOCK_ACCEPTOR > RAAcceptor;
class RAThread : public ACE_Task_Base
{
private:
ACE_Reactor *m_Reactor;
RAAcceptor *m_Acceptor;
ACE_INET_Addr listen_addr;
public:
explicit RAThread(uint16 port, const char* host);
virtual ~RAThread();
virtual int open(void* unused) override;
virtual int svc() override;
};
#endif
|
/* This file is part of the KDE project
*
* Copyright (C) 2007 Jan Hambrecht <jaham@gmx.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KOSHAPEPAINTER_H
#define KOSHAPEPAINTER_H
#include "flake_export.h"
#include <QtCore/QList>
#include <QtCore/QRectF>
class KoShape;
class KoViewConverter;
class KoShapeManagerPaintingStrategy;
class QPainter;
class QImage;
/**
* A utility class to paint a subset of shapes onto a QPainter.
* Notice that using setShapes repeatedly is very expensive, as it populates
* the shapeManager and all its caching every time. If at all possible use
* a shapeManager directly and avoid loosing the cache between usages.
*/
class FLAKE_EXPORT KoShapePainter
{
public:
KoShapePainter(KoShapeManagerPaintingStrategy *strategy = 0);
~KoShapePainter();
/**
* Sets the shapes to be painted.
* @param shapes the shapes to paint
*/
void setShapes(const QList<KoShape*> &shapes);
/**
* Paints the shapes on the given painter and using the zoom handler.
* @param painter the painter to paint on
* @param converter the view converter defining the zoom to use
*/
void paint(QPainter &painter, KoViewConverter &converter);
/**
* Paints the shapes on the given painter.
* The given document rectangle is painted to fit into the given painter rectangle.
*
* @param painter the painter to paint on
* @param painterRect the destination rectangle on the painter
* @param documentRect the document region to paint
*/
void paint(QPainter &painter, const QRect &painterRect, const QRectF &documentRect);
/**
* Paints shapes to the given image, so that all shapes fit onto it.
* @param image the image to paint into
* @return false if image is empty, else true
*/
void paint(QImage &image);
/// Returns the bounding rect of the shapes to paint
QRectF contentRect();
private:
class Private;
Private * const d;
};
#endif // KOSHAPEPAINTER_H
|
/* zpcgr.c */
#include "../Iter.h"
/*--------------------------------------------------------------------*/
/*
---------------------------------------------------------------------
purpose -- to solve a symmetric nonnegative matrix equation
Ax=b
using right preconditioned conjugate gradient method
x -- Initial guess
A -- Input matrix
M -- Front Matrix as the preconditioner
b -- Right-hand side
tol -- Convergence tolerance
type -- type of entries
SPOOLES_REAL or SPOOLES_COMPLEX
symmetryflag -- symmetry of the matrix
SPOOLES_SYMMETRIC, SPOOLES_HERMITIAN or SPOOLES_NONSYMMETRIC
nrhs -- number of right hand sides
msglvl -- message level
msgFile -- message file
return value -- error flag
created -- Oct. 27, 1998 Wei-Pai Tang
---------------------------------------------------------------------
*/
int
zpcgr (
int n_matrixSize,
int type,
int symmetryflag,
InpMtx *mtxA,
FrontMtx *Precond,
DenseMtx *mtxX,
DenseMtx *mtxB,
int itermax,
double convergetol,
int msglvl,
FILE *msgFile
)
{
Chv *chv, *rootchv ;
ChvManager *chvmanager ;
DenseMtx *mtxZ ;
DenseMtx *vecP, *vecR, *vecQ ;
DenseMtx *vecX, *vecZ ;
double Alpha[2], Beta[2], Rho[2], Rho0[2], Rtmp[2];
double Init_norm, ratio, Res_norm ;
double t1, t2, cpus[9] ;
double one[2] = {1.0, 0.0}, zero[2] = {0.0, 0.0} ;
double Tiny[2] = {0.1e-28, 0.0};
int Iter, neqns;
int stats[6] ;
if (symmetryflag != SPOOLES_HERMITIAN){
fprintf(msgFile, "\n\n Fatal Error, \n"
" Matrix is not Hermitian in ZPCGR !!") ;
exit(-1);
};
neqns = n_matrixSize;
/*
--------------------
init the vectors in ZPCGR
--------------------
*/
vecP = DenseMtx_new() ;
DenseMtx_init(vecP, type, 0, 0, neqns, 1, 1, neqns) ;
vecR = DenseMtx_new() ;
DenseMtx_init(vecR, type, 0, 0, neqns, 1, 1, neqns) ;
vecX = DenseMtx_new() ;
DenseMtx_init(vecX, type, 0, 0, neqns, 1, 1, neqns) ;
vecQ = DenseMtx_new() ;
DenseMtx_init(vecQ, type, 0, 0, neqns, 1, 1, neqns) ;
vecZ = DenseMtx_new() ;
DenseMtx_init(vecZ, type, 0, 0, neqns, 1, 1, neqns) ;
/*
--------------------------
Initialize the iterations
--------------------------
*/
Init_norm = DenseMtx_twoNormOfColumn (mtxB, 0);
if ( Init_norm == 0.0 ){
Init_norm = 1.0; };
ratio = 1.0;
DenseMtx_zero(vecX) ;
DenseMtx_colCopy (vecR, 0, mtxB, 0);
MARKTIME(t1) ;
Iter = 0;
/*
------------------------------
Main Loop of the iterations
------------------------------
*/
while ( ratio > convergetol && Iter <= itermax )
{
Iter++;
/* */
FrontMtx_solve(Precond, vecZ, vecR, Precond->manager,
cpus, msglvl, msgFile) ;
DenseMtx_colDotProduct(vecR, 0, vecZ, 0, Rho);
if ( Rho[0] == 0.0 & Rho[1] == 0.0){
fprintf(stderr, "\n breakdown in ZPCGR !! "
"\n Fatal error \n");
exit(-1) ;
}
/* */
if ( Iter == 1 ) {
DenseMtx_colCopy (vecP, 0, vecZ, 0);
} else {
zdiv(Rho, Rho0, Beta);
DenseMtx_colGenAxpy (Beta, vecP, 0, one, vecZ, 0);
};
InpMtx_herm_gmmm(mtxA, zero, vecQ, one, vecP) ;
DenseMtx_colDotProduct (vecP, 0, vecQ,0, Rtmp);
zdiv(Rho, Rtmp, Alpha);
DenseMtx_colGenAxpy (one, vecX, 0, Alpha, vecP, 0);
Rtmp[0] = -Alpha[0];
Rtmp[1] = -Alpha[1];
DenseMtx_colGenAxpy (one, vecR, 0, Rtmp, vecQ, 0);
Rho0[0] = Rho[0];
Rho0[1] = Rho[1];
/* */
Res_norm = DenseMtx_twoNormOfColumn (vecR, 0);
ratio = Res_norm/Init_norm;
fprintf(msgFile, "\n\n At iteration %d"
" the convergence ratio is %12.4e",
Iter, ratio) ;
}
/* End of while loop */
MARKTIME(t2) ;
fprintf(msgFile, "\n CPU : Converges in time: %8.3f ", t2 - t1) ;
fprintf(msgFile, "\n # iterations = %d", Iter) ;
fprintf(msgFile, "\n\n after ZPCGR") ;
DenseMtx_colCopy (mtxX, 0, vecX, 0);
/*
------------------------
free the working storage
------------------------
*/
DenseMtx_free(vecP) ;
DenseMtx_free(vecR) ;
DenseMtx_free(vecX) ;
DenseMtx_free(vecQ) ;
DenseMtx_free(vecZ) ;
fprintf(msgFile, "\n") ;
return(1) ; }
/*--------------------------------------------------------------------*/
|
/*
* Copyright (C) Boris Lechner 2009 2010 <boris.lechner.dev@gmail.com>
*
* This file is part of Galinette.
*
* Galinette 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.
*
* Galinette 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/>.
*/
/***************************************
* private const *
***************************************/
#define FIRMWARE_HEADERSIZE 64
#define FIRMWARE_HEADERCRCLEN 4
#define FIRMWARE_HEADERCRCPOS 60
#define FIRMWARE_MAXLEN 128*1024
/***************************************
* private prototypes *
***************************************/
// Error
/***************************************
* private globals *
***************************************/
extern struct ftdi_context ftdic;
|
/*
* Copyright (C) 1996-2015 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
/*
SMBlib Standard Includes
Copyright (C) 1996, Richard Sharpe
*/
/*
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.
*/
#ifndef _SMBLIB_STD_DEFINES_H
#define _SMBLIB_STD_DEFINES_H
/* RFCNB Standard includes ... */
/* One day we will conditionalize these on OS types ... */
#define BOOL int
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <signal.h>
#include <errno.h>
#include <unistd.h>
#include <strings.h>
#define TRUE 1
#define FALSE 0
#endif /* _SMBLIB_STD_DEFINES_H */
|
#ifndef __HI_CHIP_REGS_H__
#define __HI_CHIP_REGS_H__
#include <mach/io.h>
#define CRG_REG_BASE 0x20030000
#define SYS_CTRL_BASE 0x20050000
#define REG_SC_SYSRES 0x4
#define REG_BASE_TIMER0 0x20000000
#define REG_BASE_TIMER1 0x20010000
#define REG_BASE_TIMER2 0x20130000
#define REG_BASE_TIMER3 0x20140000
#define REG_BASE_UART0 0x20080000
#define REG_BASE_UART1 0x20090000
#define REG_BASE_UART2 0x200a0000
#define REG_BASE_UART3 0x200b0000
#define REG_BASE_CUR_UART REG_BASE_UART0
#define REG_BASE_L2CACHE 0x20700000
#define REG_BASE_A9_PERI 0x20300000
/*CORTTX-A9 MPCORE MEMORY REGION*/
#define REG_A9_PERI_SCU 0x0000
#define REG_A9_PERI_GIC_CPU 0x0100
#define REG_A9_PERI_GLOBAL_TIMER 0x0200
#define REG_A9_PERI_PRI_TIMER_WDT 0x0600
#define REG_A9_PERI_GIC_DIST 0x1000
#define MISC_CTRL_BASE 0x20120000
#define DDRC_BASE 0x20110000
#define CFG_GIC_CPU_BASE (IO_ADDRESS(REG_BASE_A9_PERI) + REG_A9_PERI_GIC_CPU)
#define CFG_GIC_DIST_BASE (IO_ADDRESS(REG_BASE_A9_PERI) + REG_A9_PERI_GIC_DIST)
#define UART_CKSEL_APB (1 << 19)
#endif /*End of __HI_CHIP_REGS_H__ */
|
/* vifm
* Copyright (C) 2013 xaizek.
*
* 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 VIFM__IO__IOE_H__
#define VIFM__IO__IOE_H__
#include <stddef.h> /* NULL size_t */
/* ioe - I/O error reporting - Input/Output error reporting */
enum
{
/* Special code, which means that system error code is not available for a
* particular error entry. */
IO_ERR_UNKNOWN
};
/* Possible results of the ioerr_cb callback. */
typedef enum
{
/* Failed operation should be restarted. */
IO_ECR_RETRY,
/* Operation should be skipped. */
IO_ECR_SKIP,
/* Whole action should be stopped (including all possible next operations). */
IO_ECR_BREAK
}
IoErrCbResult;
/* An error entry containing details about an issue. */
typedef struct
{
/* File path that caused the error. */
char *path;
/* System error code, which may be IO_ERR_UNKNOWN if it is not available. */
int error_code;
/* Concise error message about what the problem. */
char *msg;
}
ioe_err_t;
/* Callback used to report information about errors occurred. */
typedef IoErrCbResult (*ioerr_cb)(const ioe_err_t *err);
/* List of errors. */
typedef struct
{
/* Whether this list will be examined. */
int active;
/* Errors, can be NULL if error_count is zero. */
ioe_err_t *errors;
/* Number of accumulated error entries. */
size_t error_count;
}
ioe_errlst_t;
/* Static initializer for an error list, could be used instead of
* ioe_errlst_init(). */
#define IOE_ERRLST_INIT { .active = 1, .errors = NULL, .error_count = 0U }
/* Initializes empty error list. */
void ioe_errlst_init(ioe_errlst_t *elist);
/* Frees resources allocated by error list. elist can be NULL. */
void ioe_errlst_free(ioe_errlst_t *elist);
/* Converts list of errors from I/O module into multi-line string. Returns
* newly allocated string. */
char * ioe_errlst_to_str(const ioe_errlst_t *elist);
#endif /* VIFM__IO__IOE_H__ */
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
/* vim: set cinoptions+=t0 filetype=c : */
|
#ifndef __NuiDataType_h_
#define __NuiDataType_h_
typedef enum _NuiManagerState{
NUI_MANAGER_OK,
NUI_MANAGER_UNINITIATED,
NUI_MANAGER_API_ERROR,
NUI_MANAGER_NO_SENSOR,
NUI_MANAGER_NO_READY_SENSOR
} NuiManagerState;
#endif |
/* cdrdao - write audio CD-Rs in disc-at-once mode
*
* Copyright (C) 1998, 1999 Andreas Mueller <mueller@daneb.ping.de>
*
* 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.
*/
#ifndef __MESSAGE_BOX_H__
#define __MESSAGE_BOX_H__
#include <gtkmm.h>
#include <gtk/gtk.h>
#include <stdarg.h>
class MessageBoxBase : public Gtk::Dialog
{
public:
MessageBoxBase(Gtk::Window *);
virtual ~MessageBoxBase();
void init(const char *type, const char *titel, int askDontShow, int nButtons,
int defaultButton, Gtk::BuiltinStockID buttons[], va_list);
int run();
int dontShowAgain() const;
protected:
int done_;
int doneDefault_;
Gtk::CheckButton *dontShowAgain_;
Gtk::Button *createButton(const Gtk::BuiltinStockID);
bool on_delete_event(GdkEventAny*);
void buttonAction(int);
};
class MessageBox : public MessageBoxBase
{
public:
MessageBox(Gtk::Window *, const char *title, int askDontShow, ...);
~MessageBox();
};
class Ask2Box : public MessageBoxBase
{
public:
Ask2Box(Gtk::Window *, const char *title, int askDontShow,
int defaultButton, ...);
~Ask2Box();
};
class Ask3Box : public MessageBoxBase
{
public:
Ask3Box(Gtk::Window *, const char *title, int askDontShow,
int defaultButton, ...);
~Ask3Box();
};
class ErrorBox : public Gtk::MessageDialog
{
public:
ErrorBox(const char* msg);
};
#endif
|
/*
* (c) 2008-2009 Alexander Warg <warg@os.inf.tu-dresden.de>,
* Björn Döbel <doebel@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* This file is part of TUD:OS and distributed under the terms of the
* GNU General Public License 2.
* Please see the COPYING-GPL-2 file for details.
*/
#pragma once
#include <l4/re/util/debug>
class Err : public L4Re::Util::Err
{
public:
explicit
Err(Level l = Normal) : L4Re::Util::Err(l, "MOE") {}
};
class Dbg : public L4Re::Util::Dbg
{
public:
enum Level
{
Info = 1,
Warn = 2,
Boot = 4,
Server = 0x10,
Exceptions = 0x20,
Loader = 0x80,
Parser = 0x100,
Boot_fs = 0x200,
Name_space = 0x400,
};
struct Dbg_bits { char const *n; unsigned long bits; };
static Dbg_bits dbg_bits[];
explicit
Dbg(unsigned long mask, char const *subs = 0)
: L4Re::Util::Dbg(mask, "MOE", subs)
{}
};
|
/*
* Copyright 2011, Blender Foundation.
*
* 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.
*
* Contributor:
* Jeroen Bakker
* Monique Dewanchand
*/
#ifndef _COM_AlphaOverNode_h_
#define _COM_AlphaOverNode_h_
#include "COM_Node.h"
/**
* @brief AlphaOverNode
* @ingroup Node
*/
class AlphaOverNode : public Node {
public:
AlphaOverNode(bNode *editorNode) : Node(editorNode) {}
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
};
#endif
|
/*
* SD Memory Card emulation. Mostly correct for MMC too.
*
* Copyright (c) 2006 Andrzej Zaborowski <balrog@zabor.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 __hw_sd_h
#define __hw_sd_h 1
#define OUT_OF_RANGE (1 << 31)
#define ADDRESS_ERROR (1 << 30)
#define BLOCK_LEN_ERROR (1 << 29)
#define ERASE_SEQ_ERROR (1 << 28)
#define ERASE_PARAM (1 << 27)
#define WP_VIOLATION (1 << 26)
#define CARD_IS_LOCKED (1 << 25)
#define LOCK_UNLOCK_FAILED (1 << 24)
#define COM_CRC_ERROR (1 << 23)
#define ILLEGAL_COMMAND (1 << 22)
#define CARD_ECC_FAILED (1 << 21)
#define CC_ERROR (1 << 20)
#define SD_ERROR (1 << 19)
#define CID_CSD_OVERWRITE (1 << 16)
#define WP_ERASE_SKIP (1 << 15)
#define CARD_ECC_DISABLED (1 << 14)
#define ERASE_RESET (1 << 13)
#define CURRENT_STATE (7 << 9)
#define READY_FOR_DATA (1 << 8)
#define APP_CMD (1 << 5)
#define AKE_SEQ_ERROR (1 << 3)
typedef enum {
sd_none = -1,
sd_bc = 0, /* broadcast -- no response */
sd_bcr, /* broadcast with response */
sd_ac, /* addressed -- no data transfer */
sd_adtc, /* addressed with data transfer */
} sd_cmd_type_t;
struct sd_request_s {
uint8_t cmd;
uint32_t arg;
uint8_t crc;
};
typedef struct SDState SDState;
SDState *sd_init(BlockDriverState *bs, int is_spi);
int sd_do_command(SDState *sd, struct sd_request_s *req,
uint8_t *response);
void sd_write_data(SDState *sd, uint8_t value);
uint8_t sd_read_data(SDState *sd);
void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert);
int sd_data_ready(SDState *sd);
/* ssi-sd.c */
int ssi_sd_xfer(void *opaque, int val);
void *ssi_sd_init(BlockDriverState *bs);
#endif /* __hw_sd_h */
|
#ifndef META_CUST_BT_H
#define META_CUST_BT_H
#if defined(MTK_MT6620)
/* SERIAL PORT */
#define CUST_BT_SERIAL_PORT "/dev/stpbt"
/* BAUDRATE */
#define CUST_BT_BAUD_RATE 4000000 /*use 4M but is not controlled by bt directly */
#else
/* SERIAL PORT */
#define CUST_BT_SERIAL_PORT "/dev/ttyMT2"
/* BAUDRATE */
#define CUST_BT_BAUD_RATE 3250000
//#define CUST_BT_BAUD_RATE 921600
#endif
/* MTK BT SOLUTION */
//#define MTK_MT6611_E4
//#define MTK_MT6611_E4
//#define MTK_MT6616_E3
#endif /* FTM_CUST_BT_H */
|
/*
Copyright (C) 1994 - 2000 Evgenii Rudnyi, rudnyi@comp.chem.msu.su
http://www.chem.msu.su/~rudnyi/
This software is a copyrighted work licensed under the terms, described
in the file "FREE_LICENSE".
*/
#ifndef _COMMON_H
#define _COMMON_H
#include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;
void warning(const char* txt);
class buffer
{
char *buf;
char *cur;
size_t sz;
public:
buffer(size_t size = 10240)
{buf = new char[sz = size]; cur = buf; if (!buf) sz = 0;}
~buffer()
{delete buf;}
int free()
{return sz - busy();}
int busy()
{return cur - buf;}
void read(void* ptr)
{memcpy(ptr, buf, busy()); cur = buf;}
bool write(void* ptr, size_t n = 1);
void clear()
{cur = buf;}
char* ptr()
{return buf;}
};
extern buffer Buffer;
#endif
|
/* ------------------------------------------------------------------
* Copyright (C) 2008 PacketVideo
*
* 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.
* -------------------------------------------------------------------
*/
/****************************************************************************************
Portions of this file are derived from the following 3GPP standard:
3GPP TS 26.073
ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
Available from http://www.3gpp.org
(C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
Permission to distribute, modify and use this file under the standard license
terms listed above has been obtained from the copyright holder.
****************************************************************************************/
/*
------------------------------------------------------------------------------
Filename: /audio/gsm_amr/c/include/c3_14pf.h
Date: 01/29/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Moved _cplusplus #ifdef after Include section.
Description:
------------------------------------------------------------------------------
INCLUDE DESCRIPTION
This file contains all the constant definitions and prototype definitions
needed by c3_14pf.c
------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------
; CONTINUE ONLY IF NOT ALREADY DEFINED
----------------------------------------------------------------------------*/
#ifndef c3_14pf_h
#define c3_14pf_h "$Id $"
/*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include "typedef.h"
/*--------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C"
{
#endif
/*----------------------------------------------------------------------------
; MACROS
; Define module specific macros here
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
; DEFINES
; Include all pre-processor statements here.
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
; EXTERNAL VARIABLES REFERENCES
; Declare variables used in this module but defined elsewhere
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
; SIMPLE TYPEDEF'S
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
; ENUMERATED TYPEDEF'S
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
; STRUCTURES TYPEDEF'S
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/
Word16 code_3i40_14bits(
Word16 x[], /* (i) : target vector */
Word16 h[], /* (i) : impulse response of weighted synthesis filter */
/* h[-L_subfr..-1] must be set to zero. */
Word16 T0, /* (i) : Pitch lag */
Word16 pitch_sharp, /* (i) : Last quantized pitch gain */
Word16 code[], /* (o) : Innovative codebook */
Word16 y[], /* (o) : filtered fixed codebook excitation */
Word16 * sign, /* (o) : Signs of 3 pulses */
Flag *pOverflow
);
/*----------------------------------------------------------------------------
; END
----------------------------------------------------------------------------*/
#ifdef __cplusplus
}
#endif
#endif /* _c3_14PF_H_ */
|
#ifndef VM_EVENT_ITEM_H_INCLUDED
#define VM_EVENT_ITEM_H_INCLUDED
#ifdef CONFIG_ZONE_DMA
#define DMA_ZONE(xx) xx##_DMA,
#else
#define DMA_ZONE(xx)
#endif
#ifdef CONFIG_ZONE_DMA32
#define DMA32_ZONE(xx) xx##_DMA32,
#else
#define DMA32_ZONE(xx)
#endif
#ifdef CONFIG_HIGHMEM
#define HIGHMEM_ZONE(xx) xx##_HIGH,
#else
#define HIGHMEM_ZONE(xx)
#endif
#define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL, HIGHMEM_ZONE(xx) xx##_MOVABLE
enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
FOR_ALL_ZONES(PGALLOC),
FOR_ALL_ZONES(ALLOCSTALL),
FOR_ALL_ZONES(PGSCAN_SKIP),
PGFREE, PGACTIVATE, PGDEACTIVATE, PGLAZYFREE,
PGFAULT, PGMAJFAULT,
PGLAZYFREED,
PGREFILL,
PGSTEAL_KSWAPD,
PGSTEAL_DIRECT,
PGSCAN_KSWAPD,
PGSCAN_DIRECT,
PGSCAN_DIRECT_THROTTLE,
#ifdef CONFIG_NUMA
PGSCAN_ZONE_RECLAIM_FAILED,
#endif
PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL,
KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY,
PAGEOUTRUN, PGROTATED,
DROP_PAGECACHE, DROP_SLAB,
#ifdef CONFIG_NUMA_BALANCING
NUMA_PTE_UPDATES,
NUMA_HUGE_PTE_UPDATES,
NUMA_HINT_FAULTS,
NUMA_HINT_FAULTS_LOCAL,
NUMA_PAGE_MIGRATE,
#endif
#ifdef CONFIG_MIGRATION
PGMIGRATE_SUCCESS, PGMIGRATE_FAIL,
#endif
#ifdef CONFIG_COMPACTION
COMPACTMIGRATE_SCANNED, COMPACTFREE_SCANNED,
COMPACTISOLATED,
COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS,
KCOMPACTD_WAKE,
KCOMPACTD_MIGRATE_SCANNED, KCOMPACTD_FREE_SCANNED,
#endif
#ifdef CONFIG_HUGETLB_PAGE
HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,
#endif
UNEVICTABLE_PGCULLED, /* culled to noreclaim list */
UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */
UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */
UNEVICTABLE_PGMLOCKED,
UNEVICTABLE_PGMUNLOCKED,
UNEVICTABLE_PGCLEARED, /* on COW, page truncate */
UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
THP_FAULT_ALLOC,
THP_FAULT_FALLBACK,
THP_COLLAPSE_ALLOC,
THP_COLLAPSE_ALLOC_FAILED,
THP_FILE_ALLOC,
THP_FILE_MAPPED,
THP_SPLIT_PAGE,
THP_SPLIT_PAGE_FAILED,
THP_DEFERRED_SPLIT_PAGE,
THP_SPLIT_PMD,
#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
THP_SPLIT_PUD,
#endif
THP_ZERO_PAGE_ALLOC,
THP_ZERO_PAGE_ALLOC_FAILED,
#endif
#ifdef CONFIG_MEMORY_BALLOON
BALLOON_INFLATE,
BALLOON_DEFLATE,
#ifdef CONFIG_BALLOON_COMPACTION
BALLOON_MIGRATE,
#endif
#endif
#ifdef CONFIG_DEBUG_TLBFLUSH
NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */
NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */
NR_TLB_LOCAL_FLUSH_ALL,
NR_TLB_LOCAL_FLUSH_ONE,
#endif /* CONFIG_DEBUG_TLBFLUSH */
#ifdef CONFIG_DEBUG_VM_VMACACHE
VMACACHE_FIND_CALLS,
VMACACHE_FIND_HITS,
VMACACHE_FULL_FLUSHES,
#endif
NR_VM_EVENT_ITEMS
};
#ifndef CONFIG_TRANSPARENT_HUGEPAGE
#define THP_FILE_ALLOC ({ BUILD_BUG(); 0; })
#define THP_FILE_MAPPED ({ BUILD_BUG(); 0; })
#endif
#endif /* VM_EVENT_ITEM_H_INCLUDED */
|
/*!
@header EXFGPS Structures
Created by steve woodcock on 30/03/2008.
@copyright 2008. All rights reserved.
@discussion A set of fractions that represent the 3 rational numbers that make up the
GPS Location. these are:
Degrees
Minutes
Seconds
The EXF Specification suggests the location should be displayed as 3 rationals. Although we use fractions
to actually represent any stored number without getting precision errors.
*/
#import "EXFConstants.h"
/*!
@class EXFGPSLoc
@abstract A GPS Location
@discussion EXFGPSLoc represents a GPS Location. In order to remian aligned to the EXIF format for GPS data, the actual object is
structured as 3 EXFraction objects, one each for degrees, minutes and seconds.
*/
@interface EXFGPSLoc : NSObject {
EXFraction* degrees;
EXFraction* minutes;
EXFraction* seconds;
}
@property (nonatomic, retain) EXFraction* degrees;
@property (nonatomic, retain) EXFraction* minutes;
@property (nonatomic, retain) EXFraction* seconds;
-(double) descriptionAsDecimal;
@end
/*!
@class EXFGPSTimeStamp
@abstract A GPS Timestamp
@discussion EXFGPSTimeStamp represents a GPS Timestamp. In order to remian aligned to the EXIF format for GPS data, the actual object is
structured as 3 EXFraction objects, one each for hours, minutes and seconds.
*/
@interface EXFGPSTimeStamp : NSObject {
EXFraction* hours;
EXFraction* minutes;
EXFraction* seconds;
}
@property (nonatomic, retain) EXFraction* hours;
@property (nonatomic, retain) EXFraction* minutes;
@property (nonatomic, retain) EXFraction* seconds;
@end |
#ifndef REMU_EMULATOR_H
#define REMU_EMULATOR_H
#include "remu/Ui.h"
#include <cstdint>
#include <cstdlib>
namespace remu {
namespace bitbang {
class Nes;
} /*namespace bitbang*/
struct EmulatorOptions
{
EmulatorOptions()
: image( nullptr )
, mem_size( 0 )
, start_addr( 0 )
, quiet( 0 )
, nes_enabled( 0 )
, gpio_test_offset( 0 )
{ }
const char *image;
size_t mem_size;
uint32_t start_addr;
int quiet;
int nes_enabled;
int gpio_test_offset;
};
/**
* Emulator state
*/
class Emulator : public Ui
{
public:
Emulator(const EmulatorOptions &opt);
virtual ~Emulator() = default;
bool isRunning() const;
uint64_t getSystemTimer() const;
void info(const char *fmt, ...) override final;
void error(const char *fmt, ...) override final;
virtual void execute() = 0;
virtual void dump() = 0;
void terminate() {
terminated = true;
}
protected:
uint64_t getTime() const;
private:
int terminated;
/* Kernel image */
const char *image;
/* Arguments */
size_t mem_size;
uint32_t start_addr;
int quiet;
int nes_enabled;
/* System Timer */
uint64_t system_timer_base;
};
} /*namespace remu*/
#endif /* REMU_EMULATOR_H */
|
/**
* \file _sin.c
* \brief sin() wrapper
*
* \date 2009-10
* \author Adam Lackorzynski <adam@os.inf.tu-dresden.de>
*
*/
/*
* (c) 2009 Author(s)
* economic rights: Technische Universität Dresden (Germany)
* This file is part of TUD:OS and distributed under the terms of the
* GNU Lesser General Public License 2.1.
* Please see the COPYING-LGPL-2.1 file for details.
*/
#include <math.h>
double _sin(double x);
double _sin(double x)
{
return sin(x);
}
float _sinf(float x);
float _sinf(float x)
{
return sinf(x);
}
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (c) International Business Machines Corp., 2006
* Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
* Author: Yi Yang <yyangcdl@cn.ibm.com>
*/
#define _GNU_SOURCE
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/poll.h>
#include "tst_test.h"
#include "lapi/fcntl.h"
#include "lapi/splice.h"
#include "lapi/vmsplice.h"
#define TEST_BLOCK_SIZE (1<<17) /* 128K */
#define TESTFILE "vmsplice_test_file"
static int fd_out;
static char buffer[TEST_BLOCK_SIZE];
static void check_file(void)
{
int i;
char vmsplicebuffer[TEST_BLOCK_SIZE];
fd_out = SAFE_OPEN(TESTFILE, O_RDONLY);
SAFE_READ(1, fd_out, vmsplicebuffer, TEST_BLOCK_SIZE);
for (i = 0; i < TEST_BLOCK_SIZE; i++) {
if (buffer[i] != vmsplicebuffer[i])
break;
}
if (i < TEST_BLOCK_SIZE)
tst_res(TFAIL, "Wrong data read from the buffer at %i", i);
else
tst_res(TPASS, "Written data has been read back correctly");
SAFE_CLOSE(fd_out);
}
static void vmsplice_test(void)
{
int pipes[2];
long written;
int ret;
int fd_out;
struct iovec v;
loff_t offset;
v.iov_base = buffer;
v.iov_len = TEST_BLOCK_SIZE;
fd_out = SAFE_OPEN(TESTFILE, O_WRONLY | O_CREAT | O_TRUNC, 0644);
SAFE_PIPE(pipes);
struct pollfd pfd = {.fd = pipes[1], .events = POLLOUT};
offset = 0;
while (v.iov_len) {
/*
* in a real app you'd be more clever with poll of course,
* here we are basically just blocking on output room and
* not using the free time for anything interesting.
*/
if (poll(&pfd, 1, -1) < 0)
tst_brk(TBROK | TERRNO, "poll() failed");
written = vmsplice(pipes[1], &v, 1, 0);
if (written < 0) {
tst_brk(TBROK | TERRNO, "vmsplice() failed");
} else {
if (written == 0) {
break;
} else {
v.iov_base += written;
v.iov_len -= written;
}
}
ret = splice(pipes[0], NULL, fd_out, &offset, written, 0);
if (ret < 0)
tst_brk(TBROK | TERRNO, "splice() failed");
//printf("offset = %lld\n", (long long)offset);
}
SAFE_CLOSE(pipes[0]);
SAFE_CLOSE(pipes[1]);
SAFE_CLOSE(fd_out);
check_file();
}
static void setup(void)
{
int i;
if (tst_fs_type(".") == TST_NFS_MAGIC) {
tst_brk(TCONF, "Cannot do splice() "
"on a file located on an NFS filesystem");
}
for (i = 0; i < TEST_BLOCK_SIZE; i++)
buffer[i] = i & 0xff;
}
static void cleanup(void)
{
if (fd_out > 0)
SAFE_CLOSE(fd_out);
}
static struct tst_test test = {
.setup = setup,
.cleanup = cleanup,
.test_all = vmsplice_test,
.needs_tmpdir = 1,
.min_kver = "2.6.17",
};
|
/* lge/include/lge_isa1200.h
*
* Copyright (C) 2010 LGE, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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 __LGE_ISA1200_H__
#define __LGE_ISA1200_H__
#define LGE_ISA1200_SCTRL 0x00
#define LGE_ISA1200_HCTRL0 0x30
#define LGE_ISA1200_HCTRL1 0x31
#define LGE_ISA1200_HCTRL2 0x32
#define LGE_ISA1200_HCTRL3 0x33
#define LGE_ISA1200_HCTRL4 0x34
#define LGE_ISA1200_HCTRL5 0x35
#define LGE_ISA1200_HCTRL6 0x36
#define LGE_ISA1200_HCTRL7 0x37
#define LGE_ISA1200_HCTRL8 0x38
#define LGE_ISA1200_HCTRL9 0x39
#define LGE_ISA1200_HCTRLA 0x3A
#define LGE_ISA1200_HCTRLB 0x3B
#define LGE_ISA1200_HCTRLC 0x3C
#define LGE_ISA1200_HCTRLD 0x3D
#define LGE_ISA1200_HCTRLE 0x3E
#define LGE_ISA1200_HCTRLF 0x3F
struct isa1200_reg_cmd {
u8 addr;
u8 data;
};
/* following information is for initializing platform device */
struct isa1200_reg_seq {
struct isa1200_reg_cmd *reg_cmd_list;
unsigned int number_of_reg_cmd_list;
};
struct lge_isa1200_platform_data {
const char *vibrator_name; /* vibrator device name */
/* following information is about hw configuration */
unsigned int gpio_hen; /* Haptic Motor Driver ENable */
unsigned int gpio_len; /* LDO ENable */
//int (*power)(int enable); /* power control VBAT. NULL assumes power is always-on. */
int (*clock)(int enable, int amp); /* clock control for PWM/CLK. NULL assumes clock is always-on. */
int max_timeout; /* maximum available timeout in millisec */
int default_vib_strength; /* default vibrator strength : register LGE_ISA1200_HCTRL5 value */
struct isa1200_reg_seq *init_seq; /* initialization sequence */
};
#endif
|
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2011-2016 ArkCORE <http://www.arkania.net/>
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.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, see <http://www.gnu.org/licenses/>.
*/
#ifndef THREADING_H
#define THREADING_H
#include <ace/Thread.h>
#include <ace/TSS_T.h>
#include <ace/Atomic_Op.h>
#include <assert.h>
namespace ACE_Based
{
class Runnable
{
public:
virtual ~Runnable() { }
virtual void run() = 0;
void incReference() { ++m_refs; }
void decReference()
{
if (!--m_refs)
delete this;
}
private:
ACE_Atomic_Op<ACE_Thread_Mutex, long> m_refs;
};
enum Priority
{
Idle,
Lowest,
Low,
Normal,
High,
Highest,
Realtime
};
#define MAXPRIORITYNUM (Realtime + 1)
class ThreadPriority
{
public:
ThreadPriority();
int getPriority(Priority p) const;
private:
int m_priority[MAXPRIORITYNUM];
};
class Thread
{
public:
Thread();
explicit Thread(Runnable* instance);
~Thread();
bool start();
bool wait();
void destroy();
void suspend();
void resume();
void setPriority(Priority type);
static void Sleep(unsigned long msecs);
static ACE_thread_t currentId();
static ACE_hthread_t currentHandle();
static Thread * current();
private:
Thread(const Thread&);
Thread& operator=(const Thread&);
static ACE_THR_FUNC_RETURN ThreadTask(void * param);
ACE_thread_t m_iThreadId;
ACE_hthread_t m_hThreadHandle;
Runnable* m_task;
typedef ACE_TSS<Thread> ThreadStorage;
//global object - container for Thread class representation of every thread
static ThreadStorage m_ThreadStorage;
//use this object to determine current OS thread priority values mapped to enum Priority{ }
static ThreadPriority m_TpEnum;
};
}
#endif
|
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/poll.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <mach/regs-gpio.h>
#include <mach/hardware.h>
#include <plat/regs-timer.h>
#include <mach/regs-irq.h>
#include <asm/mach/time.h>
#include <linux/clk.h>
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/miscdevice.h>
#define DEVICE_NAME "pwm"
#define PWM_IOCTL_SET_FREQ 1
#define PWM_IOCTL_STOP 0
static struct semaphore lock;
/* freq: pclk/50/16/65536 ~ pclk/50/16
* if pclk = 50MHz, freq is 1Hz to 62500Hz
* human ear : 20Hz~ 20000Hz
*/
static void PWM_Set_Freq( unsigned long freq )
{
unsigned long tcon;
unsigned long tcnt;
unsigned long tcfg1;
unsigned long tcfg0;
struct clk *clk_p;
unsigned long pclk;
//set GPB0 as tout0, pwm output
s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0);
tcon = __raw_readl(S3C2410_TCON);
tcfg1 = __raw_readl(S3C2410_TCFG1);
tcfg0 = __raw_readl(S3C2410_TCFG0);
//prescaler = 50
tcfg0 &= ~S3C2410_TCFG_PRESCALER0_MASK;
tcfg0 |= (50 - 1);
//mux = 1/16
tcfg1 &= ~S3C2410_TCFG1_MUX0_MASK;
tcfg1 |= S3C2410_TCFG1_MUX0_DIV16;
__raw_writel(tcfg1, S3C2410_TCFG1);
__raw_writel(tcfg0, S3C2410_TCFG0);
clk_p = clk_get(NULL, "pclk");
pclk = clk_get_rate(clk_p);
tcnt = (pclk/50/16)/freq;
__raw_writel(tcnt, S3C2410_TCNTB(0));
__raw_writel(tcnt/2, S3C2410_TCMPB(0));
tcon &= ~0x1f;
tcon |= 0xb; //disable deadzone, auto-reload, inv-off, update TCNTB0&TCMPB0, start timer 0
__raw_writel(tcon, S3C2410_TCON);
tcon &= ~2; //clear manual update bit
__raw_writel(tcon, S3C2410_TCON);
}
static void PWM_Stop(void)
{
s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_setpin(S3C2410_GPB(0), 0);
}
static int s3c24xx_pwm_open(struct inode *inode, struct file *file)
{
if (!down_trylock(&lock))
return 0;
else
return -EBUSY;
}
static int s3c24xx_pwm_close(struct inode *inode, struct file *file)
{
PWM_Stop();
up(&lock);
return 0;
}
static int s3c24xx_pwm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
switch (cmd) {
case PWM_IOCTL_SET_FREQ:
if (arg == 0)
return -EINVAL;
PWM_Set_Freq(arg);
break;
case PWM_IOCTL_STOP:
PWM_Stop();
break;
}
return 0;
}
static struct file_operations dev_fops = {
.owner = THIS_MODULE,
.open = s3c24xx_pwm_open,
.release = s3c24xx_pwm_close,
.ioctl = s3c24xx_pwm_ioctl,
};
static struct miscdevice misc = {
.minor = MISC_DYNAMIC_MINOR,
.name = DEVICE_NAME,
.fops = &dev_fops,
};
static int __init dev_init(void)
{
int ret;
init_MUTEX(&lock);
ret = misc_register(&misc);
printk (DEVICE_NAME"\tinitialized\n");
return ret;
}
static void __exit dev_exit(void)
{
misc_deregister(&misc);
}
module_init(dev_init);
module_exit(dev_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("FriendlyARM Inc.");
MODULE_DESCRIPTION("S3C2410/S3C2440 PWM Driver");
|
#define HAVE_MMX 0
#define ARCH_X86 1
#define SYS_WINDOWS 1
#define STACK_ALIGNMENT 32
#define HAVE_WIN32THREAD 1
#define HAVE_THREAD 1
#define HAVE_LOG2F 0
#define HAVE_AVS 1
#define USE_AVXSYNTH 0
#define HAVE_VECTOREXT 1
#define HAVE_GPL 1
#define HAVE_INTERLACED 1
#define HAVE_OPENCL 1
#define HAVE_MALLOC_H 0
#define HAVE_ALTIVEC 0
#define HAVE_ALTIVEC_H 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
#define HAVE_NEON 0
#define HAVE_BEOSTHREAD 0
#define HAVE_POSIXTHREAD 0
#define HAVE_SWSCALE 0
#define HAVE_LAVF 0
#define HAVE_FFMS 0
#define HAVE_GPAC 0
#define HAVE_CPU_COUNT 0
#define HAVE_THP 0
#define HAVE_LSMASH 0
#define HAVE_AS_FUNC 0
#if !defined(IDE_COMPILE) || (defined(IDE_COMPILE) && (_MSC_VER >= 1310))
#define LLN(x) (x ## LL)
#define ULLN(x) (x ## ULL)
#else
#define LLN(x) ((__int64)(x))
#define ULLN(x) ((unsigned __int64)(x))
#endif
|
// swl_gps_aided_imu_filter_appDlg.h : header file
//
#pragma once
// Cswl_gps_aided_imu_filter_appDlg dialog
class Cswl_gps_aided_imu_filter_appDlg : public CDialog
{
// Construction
public:
Cswl_gps_aided_imu_filter_appDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
enum { IDD = IDD_SWL_GPS_AIDED_IMU_FILTER_APP_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedButtonUseSensorInput();
afx_msg void OnBnClickedButtonUseFileInput();
};
|
/*
* SL_WriteRead.h
*
* Created on: 2010-11-13
* Author: Danping Zou
*/
#ifndef SL_WRITEREAD_H_
#define SL_WRITEREAD_H_
#include "SL_error.h"
#include "geometry/SL_Point.h"
#include "math/SL_Matrix.h"
#include "matching/SL_Matching.h"
#include <string>
#include <fstream>
#include <vector>
#include <sstream>
/* points IO */
void write(const VecPoint2d& pts, const char* fmtstr, ...);
void read(VecPoint2d& pts, const char* fmtstr, ...);
template<class Mat>
void writeMat(const Mat& mat, const char* fmtstr, ...) {
char filePath[1024];
GET_FMT_STR(fmtstr, filePath);
using namespace std;
ofstream file(filePath);
if (!file)
repErr("write - cannot open '%s'!\n", filePath);
file.precision(24);
for (int i = 0; i < mat.rows; i++) {
for (int j = 0; j < mat.cols; j++) {
file << mat.data[i * mat.cols + j] << " ";
}
file << endl;
}
file.close();
logInfo("save '%s' [ok]\n", filePath);
}
template<class Mat>
void readMat(Mat& mat, const char* fmtstr, ...) {
char filePath[1024];
GET_FMT_STR(fmtstr, filePath);
using namespace std;
ifstream file(filePath);
if (!file)
repErr("read - cannot open '%s'!\n", filePath);
typedef typename Mat::value_type T;
vector<vector<T> > data;
string line;
int m = 0, n = 0;
while (!getline(file, line).eof()) {
istringstream reader(line);
vector<T> lineData;
int k = 0;
while (!reader.eof()) {
T val;
reader >> val;
if (!reader.fail()) {
lineData.push_back(val);
k++;
} else
break;
}
data.push_back(lineData);
if (k > n) {
n = k;
}
m++;
}
file.close();
mat.resize(m, n);
mat.fill(0);
for (size_t i = 0; i < data.size(); i++) {
for (size_t j = 0; j < data[i].size(); j++) {
mat.data[i * n + j] = data[i][j];
}
}
logInfo("read '%s' OK!\n",filePath);
}
/* array IO*/
void writeMat(int m, int n, const double* data, const char* fmstr, ...);
/* matching IO*/
void write(const Matching& matches, const char* fmstr, ...);
void read(Matching& matches, const char* fmtstr, ...);
/* read intrinsic parameters */
bool readIntrinParam(const char* fname, double* K); //K : 3x3 matrix
/* read intrinsic parameters and distortion */
bool readIntrinDistParam(const char* fname, double* K, double* D); // D : 1x5 vector
/* read K,R,t*/
bool readKRT(double* K, double* R, double* t, const char* fmstr, ...);
/*write K,R,t*/
void writeKRT(double* K, double* R, double* t, const char* fmstr, ...);
#include "geometry/SL_BundleAdjust.h"
#include "geometry/SL_Point.h"
void write(const vector<vector<Meas2D> >& vec_meas, const char* fmtstr, ...);
void read(vector<vector<Meas2D> >& vec_meas, const char* fmtstr, ...);
void write(const vector<Point3d>& vec_pts, const char* fmtstr, ...);
void read(vector<Point3d>& vec_pts, const char* fmtstr, ...);
void write(const vector<Mat_d>& vec_mat, const char* fmtstr, ...);
void read(vector<Mat_d>& vec_mat, const char* fmtstr, ...);
#endif /* SL_WRITEREAD_H_ */
|
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2011-2015 ArkCORE <http://www.arkania.net/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef TRINITYSERVER_MOVESPLINEINIT_ARGS_H
#define TRINITYSERVER_MOVESPLINEINIT_ARGS_H
#include "MoveSplineFlag.h"
#include <G3D/Vector3.h>
class Unit;
namespace Movement
{
typedef std::vector<Vector3> PointsArray;
union FacingInfo
{
struct {
float x, y, z;
} f;
uint64 target;
float angle;
FacingInfo(float o) : angle(o) { }
FacingInfo(uint64 t) : target(t) { }
FacingInfo() { }
};
struct MoveSplineInitArgs
{
MoveSplineInitArgs(size_t path_capacity = 16) : path_Idx_offset(0), velocity(0.f),
parabolic_amplitude(0.f), time_perc(0.f), splineId(0), initialOrientation(0.f),
HasVelocity(false), TransformForTransport(true)
{
path.reserve(path_capacity);
}
PointsArray path;
FacingInfo facing;
MoveSplineFlag flags;
int32 path_Idx_offset;
float velocity;
float parabolic_amplitude;
float time_perc;
uint32 splineId;
float initialOrientation;
bool HasVelocity;
bool TransformForTransport;
/** Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed. */
bool Validate(Unit* unit) const;
private:
bool _checkPathBounds() const;
};
}
#endif // TRINITYSERVER_MOVESPLINEINIT_ARGS_H
|
/*
* QEMU System Emulator
*
* Copyright (c) 2003-2008 Fabrice Bellard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "qemu-common.h"
#include "qemu-aio.h"
/* Anchor of the list of Bottom Halves belonging to the context */
static struct QEMUBH *first_bh;
/***********************************************************/
/* bottom halves (can be seen as timers which expire ASAP) */
struct QEMUBH {
QEMUBHFunc *cb;
void *opaque;
int scheduled;
int idle;
int deleted;
QEMUBH *next;
};
QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
{
QEMUBH *bh;
bh = qemu_mallocz(sizeof(QEMUBH));
bh->cb = cb;
bh->opaque = opaque;
bh->next = first_bh;
first_bh = bh;
return bh;
}
int qemu_bh_poll(void)
{
QEMUBH *bh, **bhp, *next;
int ret;
static int nesting = 0;
nesting++;
ret = 0;
for (bh = first_bh; bh; bh = next) {
next = bh->next;
if (!bh->deleted && bh->scheduled) {
bh->scheduled = 0;
if (!bh->idle)
ret = 1;
bh->idle = 0;
bh->cb(bh->opaque);
}
}
nesting--;
/* remove deleted bhs */
if (!nesting) {
bhp = &first_bh;
while (*bhp) {
bh = *bhp;
if (bh->deleted) {
*bhp = bh->next;
g_free(bh);
} else {
bhp = &bh->next;
}
}
}
return ret;
}
void qemu_bh_schedule_idle(QEMUBH *bh)
{
if (bh->scheduled)
return;
bh->scheduled = 1;
bh->idle = 1;
}
void qemu_bh_schedule(QEMUBH *bh)
{
if (bh->scheduled)
return;
bh->scheduled = 1;
bh->idle = 0;
/* stop the currently executing CPU to execute the BH ASAP */
qemu_notify_event();
}
void qemu_bh_cancel(QEMUBH *bh)
{
bh->scheduled = 0;
}
void qemu_bh_delete(QEMUBH *bh)
{
bh->scheduled = 0;
bh->deleted = 1;
}
void qemu_bh_update_timeout(int *timeout)
{
QEMUBH *bh;
for (bh = first_bh; bh; bh = bh->next) {
if (!bh->deleted && bh->scheduled) {
if (bh->idle) {
/* idle bottom halves will be polled at least
* every 10ms */
*timeout = MIN(10, *timeout);
} else {
/* non-idle bottom halves will be executed
* immediately */
*timeout = 0;
break;
}
}
}
}
|
/* AbiWord
* Copyright (C) 2003 Hubert Figuiere
*
* 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 __XAP_PRINTING_DELEGATE__
#define __XAP_PRINTING_DELEGATE__
class XAP_PrintingDelegate
{
public:
virtual ~XAP_PrintingDelegate() {}
virtual int getPageCount(void) = 0;
virtual void printPage(int pageNum) = 0;
};
#endif
|
#define PHYSICS HD
#define DIMENSIONS 1
#define COMPONENTS 1
#define GEOMETRY CARTESIAN
#define BODY_FORCE NO
#define FORCED_TURB NO
#define COOLING NO
#define RECONSTRUCTION LINEAR
#define TIME_STEPPING HANCOCK
#define DIMENSIONAL_SPLITTING YES
#define NTRACER 0
#define USER_DEF_PARAMETERS 0
/* -- physics dependent declarations -- */
#define EOS PVTE_LAW
#define ENTROPY_SWITCH NO
#define THERMAL_CONDUCTION NO
#define VISCOSITY NO
#define ROTATING_FRAME NO
/* -- user-defined parameters (labels) -- */
/* [Beg] user-defined constants (do not change this line) */
#define LIMITER VANLEER_LIM
#define UNIT_DENSITY (1.e5*CONST_amu)
#define UNIT_LENGTH (167.0*CONST_au)
#define UNIT_VELOCITY 5.25e5
/* [End] user-defined constants (do not change this line) */
|
/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only 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.
*/
#ifndef _ARCH_IOMMU_DOMAINS_H
#define _ARCH_IOMMU_DOMAINS_H
enum {
VIDEO_DOMAIN,
CAMERA_DOMAIN,
DISPLAY_DOMAIN,
ROTATOR_DOMAIN,
MAX_DOMAINS
};
enum {
VIDEO_FIRMWARE_POOL,
VIDEO_MAIN_POOL,
GEN_POOL,
};
#if defined(CONFIG_MSM_IOMMU)
extern struct iommu_domain *msm_get_iommu_domain(int domain_num);
extern unsigned long msm_allocate_iova_address(unsigned int iommu_domain,
unsigned int partition_no,
unsigned long size,
unsigned long align);
extern void msm_free_iova_address(unsigned long iova,
unsigned int iommu_domain,
unsigned int partition_no,
unsigned long size);
extern unsigned long msm_subsystem_get_domain_no(int subsys_id);
extern unsigned long msm_subsystem_get_partition_no(int subsys_id);
extern int msm_use_iommu(void);
extern int msm_iommu_map_extra(struct iommu_domain *domain,
unsigned long start_iova,
unsigned long size,
int cached);
#else
static inline struct iommu_domain
*msm_get_iommu_domain(int subsys_id) { return NULL; }
static inline unsigned long msm_allocate_iova_address(unsigned int iommu_domain,
unsigned int partition_no,
unsigned long size,
unsigned long align) { return 0; }
static inline void msm_free_iova_address(unsigned long iova,
unsigned int iommu_domain,
unsigned int partition_no,
unsigned long size) { return; }
static inline unsigned long msm_subsystem_get_domain_no(int subsys_id)
{
return 0xFFFFFFFF;
}
static inline unsigned long msm_subsystem_get_partition_no(int subsys_id)
{
return 0xFFFFFFFF;
}
static inline int msm_use_iommu(void)
{
return 0;
}
static inline int msm_iommu_map_extra(struct iommu_domain *domain,
unsigned long start_iova,
unsigned long size,
int cached)
{
return -ENODEV;
}
#endif
#endif
|
/*
* Copyright (C) 2005-2006 Pekka Enberg
*
* This file is released under the 2-clause BSD license. Please refer to the
* file LICENSE for details.
*
* The file contains functions for converting Java bytecode arithmetic
* instructions to immediate representation of the JIT compiler.
*/
#include "jit/bytecode-to-ir.h"
#include "jit/statement.h"
#include "jit/compiler.h"
#include "vm/bytecode.h"
#include "vm/die.h"
#include "lib/stack.h"
#include <errno.h>
static int convert_binop(struct parse_context *ctx, enum vm_type vm_type,
enum binary_operator binary_operator)
{
struct expression *left, *right, *expr;
right = stack_pop(ctx->bb->mimic_stack);
left = stack_pop(ctx->bb->mimic_stack);
expr = binop_expr(vm_type, binary_operator, left, right);
if (!expr)
return warn("out of memory"), -ENOMEM;
convert_expression(ctx, expr);
return 0;
}
int convert_iadd(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_ADD);
}
int convert_ladd(struct parse_context *ctx)
{
return convert_binop(ctx, J_LONG, OP_ADD);
}
int convert_fadd(struct parse_context *ctx)
{
return convert_binop(ctx, J_FLOAT, OP_FADD);
}
int convert_dadd(struct parse_context *ctx)
{
return convert_binop(ctx, J_DOUBLE, OP_DADD);
}
int convert_isub(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_SUB);
}
int convert_lsub(struct parse_context *ctx)
{
return convert_binop(ctx, J_LONG, OP_SUB);
}
int convert_fsub(struct parse_context *ctx)
{
return convert_binop(ctx, J_FLOAT, OP_FSUB);
}
int convert_dsub(struct parse_context *ctx)
{
return convert_binop(ctx, J_DOUBLE, OP_DSUB);
}
int convert_imul(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_MUL);
}
int convert_lmul(struct parse_context *ctx)
{
return convert_binop(ctx, J_LONG, OP_MUL_64);
}
int convert_fmul(struct parse_context *ctx)
{
return convert_binop(ctx, J_FLOAT, OP_FMUL);
}
int convert_dmul(struct parse_context *ctx)
{
return convert_binop(ctx, J_DOUBLE, OP_DMUL);
}
int convert_idiv(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_DIV);
}
int convert_ldiv(struct parse_context *ctx)
{
return convert_binop(ctx, J_LONG, OP_DIV_64);
}
int convert_fdiv(struct parse_context *ctx)
{
return convert_binop(ctx, J_FLOAT, OP_FDIV);
}
int convert_ddiv(struct parse_context *ctx)
{
return convert_binop(ctx, J_DOUBLE, OP_DDIV);
}
int convert_irem(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_REM);
}
int convert_lrem(struct parse_context *ctx)
{
return convert_binop(ctx, J_LONG, OP_REM_64);
}
int convert_frem(struct parse_context *ctx)
{
return convert_binop(ctx, J_FLOAT, OP_FREM);
}
int convert_drem(struct parse_context *ctx)
{
return convert_binop(ctx, J_DOUBLE, OP_DREM);
}
static int convert_unary_op(struct parse_context *ctx, enum vm_type vm_type,
enum unary_operator unary_operator)
{
struct expression *expression, *expr;
expression = stack_pop(ctx->bb->mimic_stack);
expr = unary_op_expr(vm_type, unary_operator, expression);
if (!expr)
return warn("out of memory"), -ENOMEM;
convert_expression(ctx, expr);
return 0;
}
int convert_ineg(struct parse_context *ctx)
{
return convert_unary_op(ctx, J_INT, OP_NEG);
}
int convert_lneg(struct parse_context *ctx)
{
return convert_unary_op(ctx, J_LONG, OP_NEG);
}
int convert_fneg(struct parse_context *ctx)
{
return convert_unary_op(ctx, J_FLOAT, OP_FNEG);
}
int convert_dneg(struct parse_context *ctx)
{
return convert_unary_op(ctx, J_DOUBLE, OP_DNEG);
}
int convert_ishl(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_SHL);
}
int convert_lshl(struct parse_context *ctx)
{
return convert_binop(ctx, J_LONG, OP_SHL_64);
}
int convert_ishr(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_SHR);
}
int convert_lshr(struct parse_context *ctx)
{
return convert_binop(ctx, J_LONG, OP_SHR_64);
}
int convert_iushr(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_USHR);
}
int convert_lushr(struct parse_context *ctx)
{
return convert_binop(ctx, J_LONG, OP_USHR_64);
}
int convert_iand(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_AND);
}
int convert_land(struct parse_context *ctx)
{
return convert_binop(ctx, J_LONG, OP_AND);
}
int convert_ior(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_OR);
}
int convert_lor(struct parse_context *ctx)
{
return convert_binop(ctx, J_LONG, OP_OR);
}
int convert_ixor(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_XOR);
}
int convert_lxor(struct parse_context *ctx)
{
return convert_binop(ctx, J_LONG, OP_XOR);
}
int convert_iinc(struct parse_context *ctx)
{
struct statement *store_stmt;
struct expression *local_expression, *binop_expression,
*const_expression;
unsigned int index;
int const_value;
store_stmt = alloc_statement(STMT_STORE);
if (!store_stmt)
goto failed;
if (ctx->is_wide) {
index = bytecode_read_u16(ctx->buffer);
const_value = bytecode_read_s16(ctx->buffer);
} else {
index = bytecode_read_u8(ctx->buffer);
const_value = bytecode_read_s8(ctx->buffer);
}
local_expression = local_expr(J_INT, index);
if (!local_expression)
goto failed;
store_stmt->store_dest = &local_expression->node;
const_expression = value_expr(J_INT, const_value);
if (!const_expression)
goto failed;
expr_get(local_expression);
binop_expression = binop_expr(J_INT, OP_ADD, local_expression,
const_expression);
if (!binop_expression) {
expr_put(local_expression);
expr_put(const_expression);
goto failed;
}
store_stmt->store_src = &binop_expression->node;
convert_statement(ctx, store_stmt);
return 0;
failed:
free_statement(store_stmt);
return warn("out of memory"), -ENOMEM;
}
int convert_lcmp(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_CMP);
}
int convert_xcmpl(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_CMPL);
}
int convert_xcmpg(struct parse_context *ctx)
{
return convert_binop(ctx, J_INT, OP_CMPG);
}
|
/***************************************************************************
qgsproviderrguiegistry.h
-------------------
begin : June 2019
copyright : (C) 2019 by Peter Petrik
email : zilolv at google dot com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSPROVIDERGUIREGISTRY_H
#define QGSPROVIDERGUIREGISTRY_H
#include <map>
#include <QDir>
#include <QString>
#include <QStringList>
#include <QMainWindow>
#include "qgis_gui.h"
#include "qgis_sip.h"
class QgsProjectStorageGuiProvider;
class QgsProviderGuiMetadata;
class QgsDataItemGuiProvider;
class QgsSourceSelectProvider;
class QgsProjectStorageGuiProvider;
class QgsSubsetStringEditorProvider;
class QgsProviderSourceWidgetProvider;
class QgsMapLayerConfigWidgetFactory;
class QgsMapLayer;
/**
* \ingroup gui
* \brief A registry / canonical manager of GUI parts of data providers.
*
* QgsProviderGuiRegistry is not usually directly created, but rather accessed through
* QgsGui::providerGuiRegistry().
*
* setPluginPath() should be called (once) to load dynamic providers. Static providers are
* loaded in constructor.
*
* \since QGIS 3.10
*/
class GUI_EXPORT QgsProviderGuiRegistry
{
public:
//! Creates registry and loads static provider plugins
QgsProviderGuiRegistry( const QString &pluginPath );
//! dtor
virtual ~QgsProviderGuiRegistry();
//! Returns list of available providers by their keys
QStringList providerList() const;
//! Returns metadata of the provider or NULLPTR if not found
const QgsProviderGuiMetadata *providerMetadata( const QString &providerKey ) const;
/**
* Called during GUI initialization - allows providers to do its internal initialization
* of GUI components, possibly making use of the passed pointer to the QGIS main window.
*/
void registerGuis( QMainWindow *widget );
/**
* Returns all data item gui providers registered in provider with \a providerKey
* \note Ownership of created data item providers is passed to the caller.
*/
virtual const QList<QgsDataItemGuiProvider *> dataItemGuiProviders( const QString &providerKey ) SIP_FACTORY;
/**
* Returns all source select providers registered in provider with \a providerKey
* \note Ownership of created source select providers is passed to the caller.
*/
virtual QList<QgsSourceSelectProvider *> sourceSelectProviders( const QString &providerKey ) SIP_FACTORY;
/**
* Returns all project storage gui providers registered in provider with \a providerKey
* \note Ownership of created project storage gui providers is passed to the caller.
*/
virtual QList<QgsProjectStorageGuiProvider *> projectStorageGuiProviders( const QString &providerKey ) SIP_FACTORY;
/**
* Returns all subset string editor providers registered in provider with \a providerKey
* \note Ownership of providers is passed to the caller.
* \since QGIS 3.18
*/
virtual QList<QgsSubsetStringEditorProvider *> subsetStringEditorProviders( const QString &providerKey ) SIP_FACTORY;
/**
* Returns all source widget providers registered in provider with \a providerKey
* \note Ownership of providers is passed to the caller.
* \since QGIS 3.18
*/
virtual QList<QgsProviderSourceWidgetProvider *> sourceWidgetProviders( const QString &providerKey ) SIP_FACTORY;
/**
* Returns all map layer config widget factories associated with the registered providers.
*
* The optional \a layer argument can be used to only return factories which support the specified layer.
*
* \since QGIS 3.20
*/
virtual QList<const QgsMapLayerConfigWidgetFactory *> mapLayerConfigWidgetFactories( QgsMapLayer *layer = nullptr );
//! Type for data provider metadata associative container
SIP_SKIP typedef std::map<QString, QgsProviderGuiMetadata *> GuiProviders;
private:
/**
* Loads the dynamic plugins on the given path
* When QGIS is compiled with FORCE_STATIC_PROVIDERS,
* the function is no-op
*/
void loadDynamicProviders( const QString &pluginPath );
/**
* Loads the static providers
* By default only ogr and gdal providers, but when QGIS is compiled with
* FORCE_STATIC_PROVIDERS, it also loads all the rest of providers
*/
void loadStaticProviders( );
//! Associative container of provider metadata handles
GuiProviders mProviders;
};
#endif
|
/*
* Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
*
* 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.
*/
#include <linux/compiler.h>
#include <linux/err.h>
#include <linux/init.h>
#include <mach/mx23.h>
#include <mach/mx28.h>
#include <mach/devices-common.h>
struct platform_device *__init mxs_add_gpio(
int id, resource_size_t iobase, int irq)
{
struct resource res[] = {
{
.start = iobase,
.end = iobase + SZ_8K - 1,
.flags = IORESOURCE_MEM,
}, {
.start = irq,
.end = irq,
.flags = IORESOURCE_IRQ,
},
};
return platform_device_register_resndata(&mxs_apbh_bus,
"gpio-mxs", id, res, ARRAY_SIZE(res), NULL, 0);
}
static int __init mxs_add_mxs_gpio(void)
{
if (cpu_is_mx23()) {
mxs_add_gpio(0, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO0);
mxs_add_gpio(1, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO1);
mxs_add_gpio(2, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO2);
}
if (cpu_is_mx28()) {
mxs_add_gpio(0, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO0);
mxs_add_gpio(1, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO1);
mxs_add_gpio(2, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO2);
mxs_add_gpio(3, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO3);
mxs_add_gpio(4, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO4);
}
return 0;
}
postcore_initcall(mxs_add_mxs_gpio);
|
/***************************************************************************
qgslayertreeviewfilterindicator.h
--------------------------------------
Date : January 2018
Copyright : (C) 2018 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSLAYERTREEVIEWFILTERINDICATOR_H
#define QGSLAYERTREEVIEWFILTERINDICATOR_H
#include "qgslayertreeviewindicator.h"
#include <QSet>
class QgsLayerTreeNode;
class QgsLayerTreeView;
class QgsVectorDataProvider;
//! Adds indicators showing whether vector layers have a filter applied.
class QgsLayerTreeViewFilterIndicatorProvider : public QObject
{
Q_OBJECT
public:
explicit QgsLayerTreeViewFilterIndicatorProvider( QgsLayerTreeView *view );
private slots:
//! Connects to signals of layers newly added to the tree
void onAddedChildren( QgsLayerTreeNode *node, int indexFrom, int indexTo );
//! Disconnects from layers about to be removed from the tree
void onWillRemoveChildren( QgsLayerTreeNode *node, int indexFrom, int indexTo );
//! Starts listening to layer provider's dataChanged signal
void onLayerLoaded();
//! Adds/removes indicator of a layer
void onProviderDataChanged();
void onIndicatorClicked( const QModelIndex &index );
private:
QgsLayerTreeViewIndicator *newIndicator( const QString &filter );
void updateIndicator( QgsLayerTreeViewIndicator *indicator, const QString &filter );
void addOrRemoveIndicator( QgsLayerTreeNode *node, QgsVectorDataProvider *provider );
private:
QgsLayerTreeView *mLayerTreeView;
QIcon mIcon;
QSet<QgsLayerTreeViewIndicator *> mIndicators;
};
#endif // QGSLAYERTREEVIEWFILTERINDICATOR_H
|
/*
Copyright (c) 2008-2010 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
#ifndef TC_HEADER_Volume_VolumeHeader
#define TC_HEADER_Volume_VolumeHeader
#include "Common/Tcdefs.h"
#include "Common/Volumes.h"
#include "Platform/Platform.h"
#include "Volume/EncryptionAlgorithm.h"
#include "Volume/EncryptionMode.h"
#include "Volume/Keyfile.h"
#include "Volume/VolumePassword.h"
#include "Volume/Pkcs5Kdf.h"
#include "Version.h"
// For specifications of the volume header see Common/Volumes.c
namespace TrueCrypt
{
typedef uint64 VolumeTime;
struct VolumeType
{
enum Enum
{
Unknown,
Normal,
Hidden
};
};
struct VolumeHeaderCreationOptions
{
ConstBufferPtr DataKey;
shared_ptr <EncryptionAlgorithm> EA;
shared_ptr <Pkcs5Kdf> Kdf;
ConstBufferPtr HeaderKey;
ConstBufferPtr Salt;
uint32 SectorSize;
uint64 VolumeDataSize;
uint64 VolumeDataStart;
VolumeType::Enum Type;
};
class VolumeHeader
{
public:
VolumeHeader (uint32 HeaderSize);
virtual ~VolumeHeader ();
void Create (const BufferPtr &headerBuffer, VolumeHeaderCreationOptions &options);
bool Decrypt (const ConstBufferPtr &encryptedData, const VolumePassword &password, const Pkcs5KdfList &keyDerivationFunctions, const EncryptionAlgorithmList &encryptionAlgorithms, const EncryptionModeList &encryptionModes);
void EncryptNew (const BufferPtr &newHeaderBuffer, const ConstBufferPtr &newSalt, const ConstBufferPtr &newHeaderKey, shared_ptr <Pkcs5Kdf> newPkcs5Kdf);
uint64 GetEncryptedAreaStart () const { return EncryptedAreaStart; }
uint64 GetEncryptedAreaLength () const { return EncryptedAreaLength; }
shared_ptr <EncryptionAlgorithm> GetEncryptionAlgorithm () const { return EA; }
uint32 GetFlags () const { return Flags; }
VolumeTime GetHeaderCreationTime () const { return HeaderCreationTime; }
uint64 GetHiddenVolumeDataSize () const { return HiddenVolumeDataSize; }
static size_t GetLargestSerializedKeySize ();
shared_ptr <Pkcs5Kdf> GetPkcs5Kdf () const { return Pkcs5; }
uint16 GetRequiredMinProgramVersion () const { return RequiredMinProgramVersion; }
size_t GetSectorSize () const { return SectorSize; }
static uint32 GetSaltSize () { return SaltSize; }
uint64 GetVolumeDataSize () const { return VolumeDataSize; }
VolumeTime GetVolumeCreationTime () const { return VolumeCreationTime; }
void SetSize (uint32 headerSize);
protected:
bool Deserialize (const ConstBufferPtr &header, shared_ptr <EncryptionAlgorithm> &ea, shared_ptr <EncryptionMode> &mode);
template <typename T> T DeserializeEntry (const ConstBufferPtr &header, size_t &offset) const;
template <typename T> T DeserializeEntryAt (const ConstBufferPtr &header, const size_t &offset) const;
void Init ();
void Serialize (const BufferPtr &header) const;
template <typename T> void SerializeEntry (const T &entry, const BufferPtr &header, size_t &offset) const;
uint32 HeaderSize;
static const uint16 CurrentHeaderVersion = VOLUME_HEADER_VERSION;
static const uint16 CurrentRequiredMinProgramVersion = TC_VOLUME_MIN_REQUIRED_PROGRAM_VERSION;
static const uint16 MinAllowedHeaderVersion = 1;
static const int SaltOffset = 0;
static const uint32 SaltSize = 64;
static const int EncryptedHeaderDataOffset = SaltOffset + SaltSize;
uint32 EncryptedHeaderDataSize;
static const uint32 LegacyEncryptionModeKeyAreaSize = 32;
static const int DataKeyAreaMaxSize = 256;
static const uint32 DataAreaKeyOffset = DataKeyAreaMaxSize - EncryptedHeaderDataOffset;
shared_ptr <EncryptionAlgorithm> EA;
shared_ptr <Pkcs5Kdf> Pkcs5;
uint16 HeaderVersion;
uint16 RequiredMinProgramVersion;
uint32 VolumeKeyAreaCrc32;
VolumeTime VolumeCreationTime;
VolumeTime HeaderCreationTime;
VolumeType::Enum mVolumeType;
uint64 HiddenVolumeDataSize;
uint64 VolumeDataSize;
uint64 EncryptedAreaStart;
uint64 EncryptedAreaLength;
uint32 Flags;
uint32 SectorSize;
SecureBuffer DataAreaKey;
private:
VolumeHeader (const VolumeHeader &);
VolumeHeader &operator= (const VolumeHeader &);
};
}
#endif // TC_HEADER_Volume_VolumeHeader
|
/*
* This file is part of the UCB release of Plan 9. It is subject to the license
* terms in the LICENSE file found in the top-level directory of this
* distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
* part of the UCB release of Plan 9, including this file, may be copied,
* modified, propagated, or distributed except according to the terms contained
* in the LICENSE file.
*/
#include <u.h>
#include <libc.h>
#include "fmtdef.h"
/*
* format a string into the output buffer
* designed for formats which themselves call fmt
*/
int
fmtvprint(Fmt *f, char *fmt, va_list args)
{
va_list va;
int n;
va = f->args;
f->args = args;
n = dofmt(f, fmt);
f->args = va;
if(n >= 0)
return 0;
return n;
}
|
#ifndef ColorBufferToRDRAM_H
#define ColorBufferToRDRAM_H
#include <memory>
#include <array>
#include <vector>
#include <Graphics/ObjectHandle.h>
namespace graphics {
class ColorBufferReader;
}
struct CachedTexture;
struct FrameBuffer;
class ColorBufferToRDRAM
{
public:
void init();
void destroy();
void copyToRDRAM(u32 _address, bool _sync);
void copyChunkToRDRAM(u32 _address);
static ColorBufferToRDRAM & get();
private:
ColorBufferToRDRAM();
ColorBufferToRDRAM(const ColorBufferToRDRAM &);
virtual ~ColorBufferToRDRAM();
CachedTexture * m_pTexture;
union RGBA {
struct {
u8 r, g, b, a;
};
u32 raw;
};
void _initFBTexture(void);
void _destroyFBTexure(void);
bool _prepareCopy(u32 _startAddress);
void _copy(u32 _startAddress, u32 _endAddress, bool _sync);
u32 _getRealWidth(u32 _viWidth);
// Convert pixel from video memory to N64 buffer format.
static u8 _RGBAtoR8(u8 _c);
static u16 _RGBAtoRGBA16(u32 _c);
static u32 _RGBAtoRGBA32(u32 _c);
graphics::ObjectHandle m_FBO;
FrameBuffer * m_pCurFrameBuffer;
u32 m_frameCount;
u32 m_startAddress;
u32 m_lastBufferWidth;
std::array<u32, 3> m_allowedRealWidths;
std::unique_ptr<graphics::ColorBufferReader> m_bufferReader;
};
void copyWhiteToRDRAM(FrameBuffer * _pBuffer);
#endif // ColorBufferToRDRAM
|
#ifndef QHUB_CLIENTMANAGER_H
#define QHUB_CLIENTMANAGER_H
#include "qhub.h"
#include "fast_map.h"
#include "fast_set.h"
#include "Buffer.h"
#include "Command.h"
#include "EventManager.h"
#include "Singleton.h"
#include <string>
#include <vector>
namespace qhub {
class ClientManager : public Singleton<ClientManager>, public EventListener {
public:
bool hasClient(sid_type sid, bool localonly = false) const throw();
void addLocalClient(sid_type sid, Client* client) throw();
void userUpdated(sid_type sid, UserInfo const&) throw();
void addRemoteClient(sid_type sid, UserInfo const&) throw();
void removeClient(sid_type sid) throw();
void getAllInHub(sid_type, std::vector<sid_type>&) const throw();
void getUserList(ConnectionBase*) throw();
void broadcast(const Command&) throw();
virtual void onTimer(int) throw();
void purgeQueue() throw();
void broadcastFeature(const Command&) throw();
void direct(const Command&) throw();
bool hasNick(const std::string& nick) const throw() { return nicks.count(nick); }
bool hasCid(const std::string& cid) const throw() { return cids.count(cid); }
typedef QHUB_FAST_MAP<sid_type, Client*> LocalUsers;
typedef QHUB_FAST_MAP<sid_type, UserInfo*> RemoteUsers;
private:
friend class Singleton<ClientManager>;
void fillUserListBuf(Buffer::MutablePtr);
LocalUsers localUsers;
RemoteUsers remoteUsers;
QHUB_FAST_SET<std::string> nicks;
QHUB_FAST_SET<std::string> cids;
std::vector<Command> broadcastQueue;
ClientManager() throw() {}
~ClientManager() throw() {}
};
} // namespace qhub
#endif // QHUB_CLIENTMANAGER_H
|
#ifndef _MSDOS_FS_SB
#define _MSDOS_FS_SB
#include<linux/fat_cvf.h>
/*
* MS-DOS file system in-core superblock data
*/
struct fat_mount_options {
uid_t fs_uid;
gid_t fs_gid;
unsigned short fs_umask;
unsigned short codepage; /* Codepage for shortname conversions */
char *iocharset; /* Charset used for filename input/display */
unsigned char name_check; /* r = relaxed, n = normal, s = strict */
unsigned char conversion; /* b = binary, t = text, a = auto */
unsigned quiet:1, /* set = fake successful chmods and chowns */
showexec:1, /* set = only set x bit for com/exe/bat */
sys_immutable:1, /* set = system files are immutable */
dotsOK:1, /* set = hidden and system files are named '.filename' */
isvfat:1, /* 0=no vfat long filename support, 1=vfat support */
utf8:1, /* Use of UTF8 character set (Default) */
unicode_xlate:1, /* create escape sequences for unhandled Unicode */
posixfs:1, /* Allow names like makefile and Makefile to coexist */
numtail:1, /* Does first alias have a numeric '~1' type tail? */
atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */
fat32:1; /* Is this a FAT32 partition? */
};
struct vfat_unicode {
unsigned char uni1;
unsigned char uni2;
};
struct msdos_sb_info {
unsigned short cluster_size; /* sectors/cluster */
unsigned char fats,fat_bits; /* number of FATs, FAT bits (12 or 16) */
unsigned short fat_start;
unsigned long fat_length; /* FAT start & length (sec.) */
unsigned long dir_start;
unsigned short dir_entries; /* root dir start & entries */
unsigned long data_start; /* first data sector */
unsigned long clusters; /* number of clusters */
unsigned long root_cluster; /* first cluster of the root directory */
unsigned long fsinfo_offset; /* FAT32 fsinfo offset from start of disk */
struct wait_queue *fat_wait;
int fat_lock;
int prev_free; /* previously returned free cluster number */
int free_clusters; /* -1 if undefined */
struct fat_mount_options options;
struct nls_table *nls_disk; /* Codepage used on disk */
struct nls_table *nls_io; /* Charset used for input and display */
struct cvf_format* cvf_format;
void* private_data;
};
#endif
|
/***************************************************************************
Kyugo hardware games
***************************************************************************/
/*----------- defined in drivers/kyugo.c -----------*/
MACHINE_RESET( kyugo );
WRITE8_HANDLER( kyugo_sub_cpu_control_w );
/*----------- defined in vidhrdw/kyugo.c -----------*/
extern UINT8 *kyugo_fgvideoram;
extern UINT8 *kyugo_bgvideoram;
extern UINT8 *kyugo_bgattribram;
extern UINT8 *kyugo_spriteram_1;
extern UINT8 *kyugo_spriteram_2;
READ8_HANDLER( kyugo_spriteram_2_r );
WRITE8_HANDLER( kyugo_fgvideoram_w );
WRITE8_HANDLER( kyugo_bgvideoram_w );
WRITE8_HANDLER( kyugo_bgattribram_w );
WRITE8_HANDLER( kyugo_scroll_x_lo_w );
WRITE8_HANDLER( kyugo_gfxctrl_w );
WRITE8_HANDLER( kyugo_scroll_y_w );
WRITE8_HANDLER( kyugo_flipscreen_w );
VIDEO_START( kyugo );
VIDEO_UPDATE( kyugo );
|
/***************************************************************************
qgscompositionwidget.h
------------------------
begin : June 11 2008
copyright : (C) 2008 by Marco Hugentobler
email : marco dot hugentobler at karto dot baug dot ethz dot ch
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "ui_qgscompositionwidgetbase.h"
class QgsComposition;
class QgsComposerMap;
class QgsComposerItem;
/** \ingroup MapComposer
* Struct to hold map composer paper properties.
*/
struct QgsCompositionPaper
{
QgsCompositionPaper( QString name, double width, double height ) {mName = name; mWidth = width; mHeight = height;}
QString mName;
double mWidth;
double mHeight;
};
/** \ingroup MapComposer
* Input widget for QgsComposition
*/
class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase
{
Q_OBJECT
public:
QgsCompositionWidget( QWidget* parent, QgsComposition* c );
~QgsCompositionWidget();
public slots:
void on_mPaperSizeComboBox_currentIndexChanged( const QString& text );
void on_mPaperUnitsComboBox_currentIndexChanged( const QString& text );
void on_mPaperOrientationComboBox_currentIndexChanged( const QString& text );
void on_mPaperWidthDoubleSpinBox_editingFinished();
void on_mPaperHeightDoubleSpinBox_editingFinished();
void on_mNumPagesSpinBox_valueChanged( int value );
void on_mPageStyleButton_clicked();
void on_mResolutionSpinBox_valueChanged( const int value );
void on_mPrintAsRasterCheckBox_toggled( bool state );
void on_mGenerateWorldFileCheckBox_toggled( bool state );
void on_mWorldFileMapComboBox_currentIndexChanged( int index );
void on_mGridResolutionSpinBox_valueChanged( double d );
void on_mOffsetXSpinBox_valueChanged( double d );
void on_mOffsetYSpinBox_valueChanged( double d );
void on_mGridToleranceSpinBox_valueChanged( double d );
void on_mAlignmentToleranceSpinBox_valueChanged( double d );
/**Sets GUI elements to width/height from composition*/
void displayCompositionWidthHeight();
/**Sets Print as raster checkbox value*/
void setPrintAsRasterCheckBox( bool state );
/**Sets number of pages spin box value*/
void setNumberPages();
signals:
/**Is emitted when page orientation changes*/
void pageOrientationChanged( QString orientation );
private slots:
/* when a new map is added */
void onComposerMapAdded( QgsComposerMap* );
/* when a map is deleted */
void onItemRemoved( QgsComposerItem* );
private:
QgsComposition* mComposition;
QMap<QString, QgsCompositionPaper> mPaperMap;
QgsCompositionWidget(); //default constructor is forbidden
/**Sets width/height to chosen paper format and updates paper item*/
void applyCurrentPaperSettings();
/**Applies the current width and height values*/
void applyWidthHeight();
/**Makes sure width/height values for custom paper matches the current orientation*/
void adjustOrientation();
/**Sets GUI elements to snaping distances of composition*/
void displaySnapingSettings();
void updatePageStyle();
void createPaperEntries();
void insertPaperEntries();
double size( QDoubleSpinBox *spin );
void setSize( QDoubleSpinBox *spin, double v );
/**Blocks / unblocks the signals of all items*/
void blockSignals( bool block );
};
|
/*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. 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 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.
*
* @(#)vis.h 8.1 (Berkeley) 6/2/93
*/
#ifndef _VIS_H_
#define _VIS_H_
#include <_types.h>
#ifndef _SIZE_T
#define _SIZE_T
typedef __darwin_size_t size_t;
#endif
/*
* to select alternate encoding format
*/
#define VIS_OCTAL 0x01 /* use octal \ddd format */
#define VIS_CSTYLE 0x02 /* use \[nrft0..] where appropriate */
/*
* to alter set of characters encoded (default is to encode all
* non-graphic except space, tab, and newline).
*/
#define VIS_SP 0x04 /* also encode space */
#define VIS_TAB 0x08 /* also encode tab */
#define VIS_NL 0x10 /* also encode newline */
#define VIS_WHITE (VIS_SP | VIS_TAB | VIS_NL)
#define VIS_SAFE 0x20 /* only encode "unsafe" characters */
/*
* other
*/
#define VIS_NOSLASH 0x40 /* inhibit printing '\' */
#define VIS_HTTPSTYLE 0x80 /* http-style escape % HEX HEX */
#define VIS_GLOB 0x100 /* encode glob(3) magics */
/*
* unvis return codes
*/
#define UNVIS_VALID 1 /* character valid */
#define UNVIS_VALIDPUSH 2 /* character valid, push back passed char */
#define UNVIS_NOCHAR 3 /* valid sequence, no character produced */
#define UNVIS_SYNBAD -1 /* unrecognized escape sequence */
#define UNVIS_ERROR -2 /* decoder in unknown state (unrecoverable) */
/*
* unvis flags
*/
#define UNVIS_END 1 /* no more characters */
#include <sys/cdefs.h>
__BEGIN_DECLS
char *vis(char *, int, int, int);
int strvis(char *, const char *, int);
int strvisx(char *, const char *, size_t, int);
int strunvis(char *, const char *);
int strunvisx(char *, const char *, int);
int unvis(char *, int, int *, int);
__END_DECLS
#endif /* !_VIS_H_ */
|
#define DATE "@(#) Yale compilation date:Mon May 25 21:09:40 EDT 1992"
|
unsigned char M_pydoc_data[] = {
99,0,0,0,0,0,0,0,0,1,0,0,0,64,0,0,
0,115,4,0,0,0,100,0,0,83,40,1,0,0,0,78,
40,0,0,0,0,40,0,0,0,0,40,0,0,0,0,40,
0,0,0,0,115,41,0,0,0,47,117,115,114,47,108,105,
98,47,112,121,116,104,111,110,50,46,55,47,112,121,100,111,
99,95,100,97,116,97,47,95,95,105,110,105,116,95,95,46,
112,121,116,8,0,0,0,60,109,111,100,117,108,101,62,1,
0,0,0,115,0,0,0,0,
};
|
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilSymGl.h /main/9 1995/07/14 09:39:03 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file contains external declarations of all
** global data defining the language accepted by the Uil compiler.
** This is exactly the global data generated by WML, plus any
** invariant matching definitions.
**
**--
**/
#ifndef UilSymGl_h
#define UilSymGl_h
/*
* Defined in files included in UilData.c
*/
externalref unsigned char *constraint_tab;
externalref key_keytable_entry_type *key_table;
externalref int key_k_keyword_max_length;
externalref int key_k_keyword_count;
externalref key_keytable_entry_type *key_table_case_ins;
externalref unsigned char **allowed_argument_table;
externalref unsigned char *argument_type_table;
externalref unsigned char **allowed_child_table;
externalref unsigned char *child_class_table;
externalref char **charset_xmstring_names_table;
externalref unsigned char *charset_writing_direction_table;
externalref unsigned char *charset_parsing_direction_table;
externalref unsigned char *charset_character_size_table;
externalref char **charset_lang_names_table;
externalref unsigned short int *charset_lang_codes_table;
externalref unsigned short int charset_lang_table_max;
externalref unsigned char **allowed_control_table;
externalref UilEnumSetDescDef *enum_set_table;
externalref unsigned short int *argument_enumset_table;
externalref int *enumval_values_table;
externalref int uil_max_object;
externalref char **uil_widget_names;
externalref int uil_max_arg;
externalref char **uil_argument_names;
externalref int uil_max_child;
externalref char **uil_child_names;
externalref int uil_max_reason;
externalref char **uil_reason_names;
externalref int uil_max_enumset;
externalref int uil_max_enumval;
externalref char **uil_enumval_names;
externalref int uil_max_charset;
externalref char **uil_charset_names;
externalref unsigned short int *related_argument_table;
externalref unsigned char **allowed_reason_table;
externalref char **tok_token_name_table;
externalref int tok_num_tokens;
externalref char **uil_widget_funcs;
externalref unsigned short int *uil_gadget_variants;
externalref unsigned short int *uil_urm_nondialog_class;
externalref unsigned short int *uil_urm_subtree_resource;
externalref char **uil_argument_toolkit_names;
externalref char **uil_reason_toolkit_names;
externalref unsigned short int uil_sym_user_defined_object;
externalref unsigned short int uil_sym_default_charset;
externalref unsigned short int uil_sym_isolatin1_charset;
externalref int uil_max_value;
externalref char *uil_datatype_names[];
#endif /* UilSymGl_h */
/* DON'T ADD STUFF AFTER THIS #endif */
|
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: strlook.c /main/2 1996/05/08 19:59:49 drk $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#include <ast.h>
/*
* return pointer to name in tab with element size siz
*
* the last name in tab must be 0
* 0 returned if name not found
*/
__V_*
strlook __PARAM__((const __V_* tab, int siz, register const char* name), (tab, siz, name)) __OTORP__(const __V_* tab; int siz; register const char* name;){
register char* t = (char*)tab;
register char* s;
for (; s = *((char**)t); t += siz)
if (streq(s, name))
return((__V_*)t);
return(0);
}
|
/* Yo Emacs, this -*- C++ -*-
Copyright (C) 1999-2001 Jens Hoefkens
hoefkens@pilot.msu.edu
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.
$Id: kbg.h 640692 2007-03-08 20:28:37Z lueck $
*/
#ifndef __KBG_H
#define __KBG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <kmainwindow.h>
class QSplitter;
class QCheckBox;
class QPopupMenu;
class QLabel;
class KAction;
class KSelectAction;
class KLineEdit;
class KDialogBase;
class KDoubleNumInput;
class KBgEngine;
class KBgTextView;
class KBgBoardSetup;
class KBg : public KMainWindow
{
Q_OBJECT
public:
/**
* Constructor creates the full main window
*/
KBg();
/**
* Destructor
*/
virtual ~KBg();
/**
* Read various settings from the configuration files or
* set some reasonable defaults
*/
void readConfig();
public slots:
/**
* Set the caption to KFIBS_NAME + string + pipcount (if requested by
* the user)
*/
void updateCaption(const QString &s);
/**
* Slot to be called by the engine - it enables/disables buttons
* in the button bar
*/
void allowCommand(int cmd, bool f);
/**
* Sets the backgammon engine to type
*/
void setupEngine();
void startKCM(const QString &);
signals:
/**
* Tell all listeners to write their settings to disk
*/
void saveSettings();
/**
* Tell all listeners to restore their settings or use reasonable
* defaults
*/
void readSettings();
protected:
/*
* Windows are to be hidden
*/
virtual void hideEvent(QHideEvent *);
/*
* Redisplay the windows
*/
virtual void showEvent(QShowEvent *);
/*
* Called before the window is closed. Check with the engine
* if that is okay.
*/
virtual bool queryClose();
protected slots:
/**
* Show the button bar - or not - depending on the corresponding action
*/
void toggleMenubar();
void configureToolbars();
void newToolbarConfig();
/**
* Starts the print dialog and asks the board to print itself
*/
void print();
void openNew();
/**
* Takes text from the commandline and hands it over to the
* current engine
*/
void handleCmd(const QString &);
/**
* Saves the user settings to disk
*/
void saveConfig();
/**
* Slots for the respective actions - called by the button bar
* and some global key shortcuts
*/
void undo();
void redo();
void roll();
void cube();
void load();
void done();
/**
* Opens and displays the respective home pages
*/
void showWWW(int t);
void wwwFIBS();
void wwwRule();
/**
* Show the big setup dialog
*/
void setupDlg();
/**
* Save the settings
*/
void setupOk();
/**
* Delete the setup dialog
*/
void setupDone();
/**
* Load default values for user settings
*/
void setupDefault();
/**
* Undo the settings
*/
void setupCancel();
private:
KAction *newAction, *undoAction, *redoAction, *rollAction, *cubeAction, *endAction, *loadAction;
/*
* Each engine has its own identifier.
*/
enum Engines {None = -1, Offline, FIBS, GNUbg, NextGen, MaxEngine};
QString engineString[MaxEngine];
KBgEngine *engine[MaxEngine];
int currEngine;
QPopupMenu *dummyPopup;
enum HelpTopics {FIBSHome, RuleHome, MaxHelpTopic};
QString helpTopic[MaxHelpTopic][2];
KSelectAction *engineSet;
/**
* Notebook for the setup
*/
KDialogBase *nb;
KDoubleNumInput *sbt;
QCheckBox *cbt, *cbs, *cbm;
/*
* UI elements
*/
QSplitter *panner;
KBgBoardSetup *board;
KBgTextView *status;
KLineEdit *cmdLine;
QLabel *cmdLabel;
QString baseCaption; // for user friendly printing, we keep it around
};
#endif // __KBG_H
|
/*********************************************************************
CombLayer : MNCPX Input builder
* File: t1BuildInc/MerlinPipe.h
*
* Copyright (c) 2004-2013 by Stuart Ansell
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
****************************************************************************/
#ifndef moderatorSystem_MerlinPipe_h
#define moderatorSystem_MerlinPipe_h
class Simulation;
namespace ts1System
{
/*!
\class MerlinPipe
\version 1.0
\author S. Ansell
\date July 2011
\brief MerlinPipe [insert object]
*/
class MerlinPipe : public attachSystem::FixedComp
{
private:
const int pipeIndex; ///< Index of surface offset
int cellIndex; ///< Cell index
ModelSupport::PipeLine Central; ///< Global outer
ModelSupport::PipeLine WatIn; ///< Inner Hydrogen pipe
ModelSupport::PipeLine WatOut; ///< Inner Hydrogen pipe
double Xoffset; ///< Pipe offset [x]
double Yoffset; ///< Pipe offset [y]
int outMat; ///< Outer material
int outVacMat; ///< Outer material
int midMat; ///< Outer material
int midVacMat; ///< Outer material
int watSkinMat; ///< Outer material
int watMat; ///< Outer material
double outRadius; ///< Outer Radius
double outVacRadius; ///< Outer Al-Radius
double midRadius; ///< Outer Vac-Thickness
double midVacRadius; ///< Outer Vac-Thickness
double watSkinRadius; ///< Inner Al-Thickness
double watRadius; ///< Inner Radius
double fullLen; ///< Outer Height
double wInXoffset; ///< Pipe offset [x]
double wInYoffset; ///< Pipe offset [y]
double wOutXoffset; ///< Pipe offset [x]
double wOutYoffset; ///< Pipe offset [y]
void populate(const Simulation&);
void createUnitVector(const attachSystem::FixedComp&,const size_t);
void insertPipes(Simulation&);
void insertOuter(Simulation&,const attachSystem::FixedComp&,const size_t);
public:
MerlinPipe(const std::string&);
MerlinPipe(const MerlinPipe&);
MerlinPipe& operator=(const MerlinPipe&);
~MerlinPipe();
void createAll(Simulation&,const attachSystem::FixedComp&,
const size_t);
};
}
#endif
|
/*
AP_InternalError holds information about "should not happen" errors
that have occured within ArduPilot. This covers things like code
paths that should not be crossed or pointers being null when they
really, really shouldn't be. It does NOT cover things like losing
GPS lock at inopportune times - that's just bad luck, not bad
programming.
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stdint.h>
class AP_InternalError {
public:
// internal error counters. Do not set these unless it is a
// *true* internal error - a thread locking up, a codepath which
// should never be taken, a code-sanity-check failing, that sort
// of thing. Examples of what NOT to put in here - sd card
// filling up, bad input received from GCS, GPS unit was working
// and now is not.
enum class error_t {
logger_mapfailure = (1U << 0),
logger_missing_logstructure = (1U << 1),
logger_logwrite_missingfmt = (1U << 2),
logger_too_many_deletions = (1U << 3),
logger_bad_getfilename = (1U << 4),
unused1 = (1U << 5), // was logger_stopping_without_sem
logger_flushing_without_sem = (1U << 6),
logger_bad_current_block = (1U << 7),
logger_blockcount_mismatch = (1U << 8),
logger_dequeue_failure = (1U << 9),
constraining_nan = (1U << 10),
watchdog_reset = (1U << 11),
iomcu_reset = (1U << 12),
iomcu_fail = (1U << 13),
spi_fail = (1U << 14),
main_loop_stuck = (1U << 15),
gcs_bad_missionprotocol_link= (1U << 16),
bitmask_range = (1U << 17),
gcs_offset = (1U << 18),
i2c_isr = (1U << 19),
flow_of_control = (1U << 20), // for generic we-should-never-get-here situations
};
void error(const AP_InternalError::error_t error);
uint32_t count() const { return total_error_count; }
// internal_errors - return mask of internal errors seen
uint32_t errors() const {
return internal_errors;
}
private:
// bitmask holding errors from internal_error_t
uint32_t internal_errors;
uint32_t total_error_count;
};
namespace AP {
AP_InternalError &internalerror();
};
|
/* Save the list of files in a directory in a string.
Copyright (C) 1997, 1999, 2001, 2003, 2005, 2009-2019 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#ifndef _GL_SAVEDIR_H
#define _GL_SAVEDIR_H
#include <dirent.h>
enum savedir_option
{
SAVEDIR_SORT_NONE,
SAVEDIR_SORT_NAME,
#if D_INO_IN_DIRENT
SAVEDIR_SORT_INODE,
SAVEDIR_SORT_FASTREAD = SAVEDIR_SORT_INODE
#else
SAVEDIR_SORT_FASTREAD = SAVEDIR_SORT_NONE
#endif
};
char *streamsavedir (DIR *, enum savedir_option);
char *savedir (char const *, enum savedir_option);
#endif
|
/**************************************************************************
* Copyright (C) 2008 - 2012 by Simon Qian *
* SimonQian@SimonQian.com *
* *
* Project: Versaloon *
* File: hw_cfg_VSFCore_STM32.h *
* Author: SimonQian *
* Versaion: See changelog *
* Purpose: hardware configuration file for VSFCore_STM32 *
* License: See license *
*------------------------------------------------------------------------*
* Change Log: *
* YYYY-MM-DD: What(by Who) *
* 2008-11-07: created(by SimonQian) *
* 2008-11-22: rewrite GPIO_Dir(by SimonQian) *
**************************************************************************/
#define SYS_MAIN_ADDR 0
#define APP_MAIN_ADDR (SYS_MAIN_ADDR + 512 * 1024)
// USB
#define USB_PULLUP_PORT 0xFF
#define USB_PULLUP_PIN 0
#define KEY_PORT VSFHAL_DUMMY_PORT
#define KEY_PIN 0
// bcm wifi
#define BCM_PORT_TYPE BCM_BUS_TYPE_SDIO
#define BCM_PORT 1
#define BCM_FREQ 32000 //48000
#if BCM_PORT_TYPE == BCM_BUS_TYPE_SPI
#define BCM_RST_PORT 2
#define BCM_RST_PIN 14
#define BCM_WAKEUP_PORT 2
#define BCM_WAKEUP_PIN 13
#define BCM_MODE_PORT 2
#define BCM_MODE_PIN 12
#define BCM_SPI_CS_PORT 1
#define BCM_SPI_CS_PIN 10
#define BCM_EINT_PORT 2
#define BCM_EINT_PIN 5
#define BCM_EINT 0x52
#endif
#define BCM_PWRCTRL_PORT VSFHAL_DUMMY_PORT
#define BCM_PWRCTRL_PIN 0
#define BCM_CFG_FWADDR 0x00020000
|
/*
This file is part of Darling.
Copyright (C) 2017 Lubos Dolezel
Darling is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Foundation/Foundation.h>
@protocol DDHighlightsDelegate
@end
|
/*******************************************************************************
* FILENAME: cymetadata.c
*
* PSoC Creator 3.1
*
* DESCRIPTION:
* This file defines all extra memory spaces that need to be included.
* This file is automatically generated by PSoC Creator.
*
********************************************************************************
* Copyright 2008-2013, Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
********************************************************************************/
#include "cytypes.h"
#if defined(__GNUC__) || defined(__ARMCC_VERSION)
__attribute__ ((__section__(".cyloadermeta"), used))
#elif defined(__ICCARM__)
#pragma location=".cyloadermeta"
#else
#error "Unsupported toolchain"
#endif
const uint8 cy_meta_loader[] = {
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x01u, 0x00u, 0x01u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u
};
#if defined(__GNUC__) || defined(__ARMCC_VERSION)
__attribute__ ((__section__(".cyconfigecc"), used))
#elif defined(__ICCARM__)
#pragma location=".cyconfigecc"
#else
#error "Unsupported toolchain"
#endif
const uint8 cy_meta_configecc[] = {
0x00u
};
#if defined(__GNUC__) || defined(__ARMCC_VERSION)
__attribute__ ((__section__(".cycustnvl"), used))
#elif defined(__ICCARM__)
#pragma location=".cycustnvl"
#else
#error "Unsupported toolchain"
#endif
const uint8 cy_meta_custnvl[] = {
0x00u, 0x00u, 0x40u, 0x05u
};
#if defined(__GNUC__) || defined(__ARMCC_VERSION)
__attribute__ ((__section__(".cywolatch"), used))
#elif defined(__ICCARM__)
#pragma location=".cywolatch"
#else
#error "Unsupported toolchain"
#endif
const uint8 cy_meta_wonvl[] = {
0xBCu, 0x90u, 0xACu, 0xAFu
};
#if defined(__GNUC__) || defined(__ARMCC_VERSION)
__attribute__ ((__section__(".cyflashprotect"), used))
#elif defined(__ICCARM__)
#pragma location=".cyflashprotect"
#else
#error "Unsupported toolchain"
#endif
const uint8 cy_meta_flashprotect[] = {
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u,
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u
};
#if defined(__GNUC__) || defined(__ARMCC_VERSION)
__attribute__ ((__section__(".cymeta"), used))
#elif defined(__ICCARM__)
#pragma location=".cymeta"
#else
#error "Unsupported toolchain"
#endif
const uint8 cy_metadata[] = {
0x00u, 0x01u, 0x2Eu, 0x13u, 0x30u, 0x69u, 0x00u, 0x01u,
0x00u, 0x00u, 0x00u, 0x00u
};
|
/*!@addtogroup HiTechnic
* @{
* @defgroup htirr IR Receiver Sensor
* HiTechnic IR Receiver Sensor
* @{
*/
/*
* $Id: hitechnic-irrecv.h 133 2013-03-10 15:15:38Z xander $
*/
#ifndef __HTIRR_H__
#define __HTIRR_H__
/** \file hitechnic-irrecv.h
* \brief HiTechnic IR Receiver Sensor driver
*
* HTIRR2-driver.h provides an API for the IR Receiver Sensor driver.
*
* Changelog:
* - 0.1: Initial release
* - 0.2: Changed HTIRRreadChannel() proto to use signed bytes like function.
*
* Credits:
* - Big thanks to HiTechnic for providing me with the hardware necessary to write and test this.
*
* License: You may use this code as you wish, provided you give credit where its due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.59 AND HIGHER.
* \author Xander Soldaat (xander_at_botbench.com)
* \date 03 November 2009
* \version 0.2
* \example hitechnic-irrecv-test1.c
*/
#pragma systemFile
#ifndef __COMMON_H__
#include "common.h"
#endif
#define HTIRR_I2C_ADDR 0x02 /*!< HTIRR I2C device address */
#define HTIRR_OFFSET 0x42 /*!< Offset for data registers */
// Values contained by registers in active mode
#define HTIRR_MOTOR_1A 0x00 /*!< Color number */
#define HTIRR_MOTOR_1B 0x01 /*!< Color number */
#define HTIRR_MOTOR_2A 0x02 /*!< Color number */
#define HTIRR_MOTOR_2B 0x03 /*!< Color number */
#define HTIRR_MOTOR_3A 0x04 /*!< Color number */
#define HTIRR_MOTOR_3B 0x05 /*!< Color number */
#define HTIRR_MOTOR_4A 0x06 /*!< Color number */
#define HTIRR_MOTOR_4B 0x07 /*!< Color number */
/*! Some define. */
#define HTIRR_MOTOR_BRAKE -128 /*!< Motor brake */
/*
<function prototypes>
*/
bool HTIRRreadChannel(tSensors link, byte channel, sbyte &motA, sbyte &motB);
bool HTIRRreadAllChannels(tSensors link, tsByteArray &motorSpeeds);
tByteArray HTIRR_I2CRequest; /*!< Array to hold I2C command data */
tByteArray HTIRR_I2CReply; /*!< Array to hold I2C reply data */
/**
* Get the speeds of the motors for a given channel.
* @param link the HTIRR port number
* @param channel the channel number (1 to 4)
* @param motA the speed for Motor A (-100 to +100, -128 = brake)
* @param motB the speed for Motor B (-100 to +100, -128 = brake)
* @return true if no error occured, false if it did
*/
bool HTIRRreadChannel(tSensors link, byte channel, sbyte &motA, sbyte &motB) {
memset(HTIRR_I2CRequest, 0, sizeof(tByteArray));
HTIRR_I2CRequest[0] = 2; // Message size
HTIRR_I2CRequest[1] = HTIRR_I2C_ADDR; // I2C Address
HTIRR_I2CRequest[2] = HTIRR_OFFSET + ((channel - 1) * 2); // Start of speed registry
if (!writeI2C(link, HTIRR_I2CRequest, HTIRR_I2CReply, 2))
return false;
motA = (HTIRR_I2CReply[0] >= 128) ? (int)HTIRR_I2CReply[0] - 256 : (int)HTIRR_I2CReply[0];
motB = (HTIRR_I2CReply[1] >= 128) ? (int)HTIRR_I2CReply[1] - 256 : (int)HTIRR_I2CReply[1];
return true;
}
/**
* Get the speeds of the motors for all channels.
* @param link the HTIRR port number
* @param motorSpeeds the speeds for all the motors (-100 to +100, -128 = brake)
* @return true if no error occured, false if it did
*/
bool HTIRRreadAllChannels(tSensors link, tsByteArray &motorSpeeds){
memset(motorSpeeds, 0, sizeof(tsByteArray));
memset(HTIRR_I2CRequest, 0, sizeof(tByteArray));
HTIRR_I2CRequest[0] = 2; // Message size
HTIRR_I2CRequest[1] = HTIRR_I2C_ADDR; // I2C Address
HTIRR_I2CRequest[2] = HTIRR_OFFSET; // Start of speed registry
if (!writeI2C(link, HTIRR_I2CRequest, HTIRR_I2CReply, 8))
return false;
memcpy(motorSpeeds, HTIRR_I2CReply, 8);
return true;
}
#endif // __HTIRR_H__
/*
* $Id: hitechnic-irrecv.h 133 2013-03-10 15:15:38Z xander $
*/
/* @} */
/* @} */
|
// Rf386.h
#ifndef RF386_H
#define RF386_H
void setRf386BandSignal(unsigned long freq);
#endif
|
/*
Copyright (C) 1996-2013 John W. Eaton
This file is part of Octave.
Octave is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
Octave 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 Octave; see the file COPYING. If not, see
<http://www.gnu.org/licenses/>.
*/
#if !defined (octave_oct_group_h)
#define octave_oct_group_h 1
#include <string>
#include <sys/types.h>
#include "str-vec.h"
class
OCTAVE_API
octave_group
{
public:
octave_group (void)
: gr_name (), gr_passwd (), gr_gid (0), gr_mem (), valid (false)
{ }
octave_group (const octave_group& gr)
: gr_name (gr.gr_name), gr_passwd (gr.gr_passwd),
gr_gid (gr.gr_gid), gr_mem (gr.gr_mem), valid (gr.valid)
{ }
octave_group& operator = (const octave_group& gr)
{
if (this != &gr)
{
gr_name = gr.gr_name;
gr_passwd = gr.gr_passwd;
gr_gid = gr.gr_gid;
gr_mem = gr.gr_mem;
valid = gr.valid;
}
return *this;
}
std::string name (void) const;
std::string passwd (void) const;
gid_t gid (void) const;
string_vector mem (void) const;
bool ok (void) const { return valid; }
operator bool () const { return ok (); }
static octave_group getgrent (void);
static octave_group getgrent (std::string& msg);
static octave_group getgrgid (gid_t gid);
static octave_group getgrgid (gid_t gid, std::string& msg);
static octave_group getgrnam (const std::string& nm);
static octave_group getgrnam (const std::string& nm, std::string& msg);
static int setgrent (void);
static int setgrent (std::string& msg);
static int endgrent (void);
static int endgrent (std::string& msg);
private:
// The group name.
std::string gr_name;
// The group password.
std::string gr_passwd;
// The numeric group id.
gid_t gr_gid;
// The members of the group;
string_vector gr_mem;
// Flag that says whether we have been properly initialized.
bool valid;
// This is how we will create an octave_group object from a pointer
// to a struct group.
octave_group (void *p, std::string& msg);
void gripe_invalid (void) const;
};
#endif
|
// ======================================================================== //
// Copyright 2009-2013 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
// You may obtain a copy of the License at //
// //
// http://www.apache.org/licenses/LICENSE-2.0 //
// //
// Unless required by applicable law or agreed to in writing, software //
// distributed under the License is distributed on an "AS IS" BASIS, //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and //
// limitations under the License. //
// ======================================================================== //
#ifndef __EMBREE_BVH4MB_INTERSECTOR4_CHUNK_H__
#define __EMBREE_BVH4MB_INTERSECTOR4_CHUNK_H__
#include "bvh4mb.h"
#include "../include/intersector4.h"
namespace embree
{
/*! BVH4MB Traverser. Packet traversal implementation for a Quad BVH. */
template<typename TriangleIntersector>
class BVH4MBIntersector4Chunk : public Intersector4
{
/* shortcuts for frequently used types */
typedef typename TriangleIntersector::Triangle Triangle;
typedef typename BVH4MB::Base Base;
typedef typename BVH4MB::Node Node;
public:
BVH4MBIntersector4Chunk (const BVH4MB* bvh)
: Intersector4((intersectFunc)intersect,(occludedFunc)occluded), bvh(bvh) {}
static Intersector4* create(const Accel* bvh) {
return new BVH4MBIntersector4Chunk((const BVH4MB*)bvh);
}
static void intersect(const BVH4MBIntersector4Chunk* This, Ray4& ray, const __m128 valid);
static __m128 occluded (const BVH4MBIntersector4Chunk* This, Ray4& ray, const __m128 valid);
private:
const BVH4MB* bvh;
};
}
#endif
|
/*
* This file is part of the SYMPLER package.
* https://github.com/kauzlari/sympler
*
* Copyright 2002-2018,
* David Kauzlaric <david.kauzlaric@imtek.uni-freiburg.de>,
* and others authors stated in the AUTHORS file in the top-level
* source directory.
*
* SYMPLER is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SYMPLER 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 SYMPLER. If not, see <http://www.gnu.org/licenses/>.
*
* Please cite the research papers on SYMPLER in your own publications.
* Check out the PUBLICATIONS file in the top-level source directory.
*
* You are very welcome to contribute extensions to the code. Please do
* so by making a pull request on https://github.com/kauzlari/sympler
*
*/
#ifndef __CBL_PAIR_PARTICLE_VECTOR_TEST_H
#define __CBL_PAIR_PARTICLE_VECTOR_TEST_H
#include "cbl_pair_particle_arbitraryTest.h"
#include "cbl_pair_particle_vector.h"
using namespace std;
/*!
* Test class for class \a CblPairParticleVector
* FIXME: setup() and call() not tested yet!
*/
class CblPairParticleVectorTest : public CblPairParticleArbitraryTest
{
CPPUNIT_TEST_SUITE (CblPairParticleVectorTest);
CPPUNIT_TEST (initTest);
CPPUNIT_TEST_SUITE_END ();
public:
/*!
* Initialise used objects
*/
virtual void setUp (void);
/*!
* Delete used objects
*/
virtual void tearDown (void);
protected:
/*!
* Test init function
*/
virtual void initTest (void);
private:
};
#endif
|
/***************************************************************************/
/* */
/* pshnterr.h */
/* */
/* PS Hinter error codes (specification only). */
/* */
/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This file is used to define the PSHinter error enumeration constants. */
/* */
/*************************************************************************/
#ifndef PSHNTERR_H_
#define PSHNTERR_H_
#include FT_MODULE_ERRORS_H
#undef FTERRORS_H_
#undef FT_ERR_PREFIX
#define FT_ERR_PREFIX PSH_Err_
#define FT_ERR_BASE FT_Mod_Err_PShinter
#include FT_ERRORS_H
#endif /* PSHNTERR_H_ */
/* END */
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-cen-xr-w32-bld/build/uriloader/exthandler/nsCExternalHandlerService.idl
*/
#ifndef __gen_nsCExternalHandlerService_h__
#define __gen_nsCExternalHandlerService_h__
#ifndef __gen_nsIExternalHelperAppService_h__
#include "nsIExternalHelperAppService.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* A7F800E0-4306-11d4-98D0-001083010E9B */
#define NS_EXTERNALHELPERAPPSERVICE_CID \
{ 0xa7f800e0, 0x4306, 0x11d4, { 0x98, 0xd0, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b } }
#define NS_EXTERNALHELPERAPPSERVICE_CONTRACTID \
"@mozilla.org/uriloader/external-helper-app-service;1"
#define NS_HANDLERSERVICE_CONTRACTID \
"@mozilla.org/uriloader/handler-service;1"
#define NS_EXTERNALPROTOCOLSERVICE_CONTRACTID \
"@mozilla.org/uriloader/external-protocol-service;1"
#define NS_MIMESERVICE_CONTRACTID \
"@mozilla.org/mime;1"
#define NS_EXTERNALPROTOCOLHANDLER_CID \
{ 0xbd6390c8, 0xfbea, 0x11d4, {0x98, 0xf6, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b } }
/* 9fa83ce7-d0ab-4ed3-938e-afafee435670 */
#define NS_BLOCKEDEXTERNALPROTOCOLHANDLER_CID \
{ 0x9fa83ce7, 0xd0ab, 0x4ed3, {0x93, 0x8e, 0xaf, 0xaf, 0xee, 0x43, 0x56, 0x70 } }
/* bc0017e3-2438-47be-a567-41db58f17627 */
#define NS_LOCALHANDLERAPP_CID \
{ 0xbc0017e3, 0x2438, 0x47be, {0xa5, 0x67, 0x41, 0xdb, 0x58, 0xf1, 0x76, 0x27 } }
/*6c3c274b-4cbf-4bb5-a635-05ad2cbb6535*/
#define NS_DBUSHANDLERAPP_CID \
{ 0x6c3c274b, 0x4cbf, 0x4bb5, {0xa6, 0x35, 0x05, 0xad, 0x2c, 0xbb, 0x65, 0x35 } }
#define NS_DBUSHANDLERAPP_CONTRACTID \
"@mozilla.org/uriloader/dbus-handler-app;1"
#define NS_LOCALHANDLERAPP_CONTRACTID \
"@mozilla.org/uriloader/local-handler-app;1"
#define NS_WEBHANDLERAPP_CONTRACTID \
"@mozilla.org/uriloader/web-handler-app;1"
#endif /* __gen_nsCExternalHandlerService_h__ */
|
/*
This file is part of Darling.
Copyright (C) 2019 Lubos Dolezel
Darling is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Foundation/Foundation.h>
@interface EKRevertOperation : NSObject
@end
|
#pragma once
#include <QMultiMap>
#include <QMapIterator>
template<class T>
class TopNSearch {
public:
static enum { ORDER_ASC = 0, ORDER_DESC };
private:
QMultiMap<qreal, T> data;
public:
TopNSearch() {}
~TopNSearch() {}
void add(qreal key, const T value) {
data.insert(key, value);
}
QList<T> topN(int n, int orderType) {
QList<T> ret;
int count = 0;
if (orderType == ORDER_ASC) {
for (QMultiMap<qreal, T>::iterator it = data.begin(); it != data.end() && count < n; ++it) {
QList<T> values = data.values(it.key());
for (int i = 0; i < values.size() && count < n; i++, count++) {
ret.push_back(values[i]);
}
}
} else {
QMapIterator<qreal, T> it(data);
it.toBack();
while (it.hasPrevious() && count < n) {
it.previous();
QList<T> values = data.values(it.key());
for (int i = 0; i < values.size() && count < n; i++, count++) {
ret.push_back(values[i]);
}
}
}
return ret;
}
size_t size() const {
return data.size();
}
};
|
/*
* Copyright 2013 Sveriges Television AB http://casparcg.com/
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CasparCG 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 CasparCG. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Robert Nagy, ronag89@gmail.com
*/
#pragma once
#include <common/memory/safe_ptr.h>
#include <boost/noncopyable.hpp>
#include <memory>
namespace caspar { namespace core {
class device_buffer : boost::noncopyable
{
public:
size_t stride() const;
size_t width() const;
size_t height() const;
void bind(int index);
void unbind();
void begin_read();
bool ready() const;
private:
friend class ogl_device;
device_buffer(size_t width, size_t height, size_t stride);
int id() const;
struct implementation;
safe_ptr<implementation> impl_;
};
unsigned int format(size_t stride);
}} |
/*
This file is part of Darling.
Copyright (C) 2017 Lubos Dolezel
Darling is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Foundation/Foundation.h>
@interface CIImageProcessorInput : NSObject
@end
|
#pragma once
#include "DisplayableObject.h"
#include "Animation.h"
class SpotLight :
public DisplayableObject,
public Animation
{
public:
SpotLight(GLenum lightNum, int specialLightFlag);
~SpotLight();
void SetAmbient(float r, float g, float b, float a);
void SetDiffuse(float r, float g, float b, float a);
void SetSpecular(float r, float g, float b, float a);
void SetAttenuation(float constant, float linear, float quadratic);
void SetSpotDirection(float x, float y, float z);
void SetSpotExponent(float e);
void SetSpotCutOff(float d);
void Display();
void Update(const double& deltaTime);
private:
GLenum lightNum;
float ambient[4];
float diffuse[4];
float specular[4];
float attenuation[3];
float spotDir[4];
float spotExponent;
float spotCutOff;
int flag, pmFlag;
};
|
1) int**F(int *x){
int **p = &x;
x++;
return p;
}
main(){
int A[] = {0,1,2,3,4}, *q = A+2;
**F(q) = (*q)++; cout << *(A+2) >> *(A+3) << *(A+4) << endl;
}
/* Il tipo di ritorno della funzione F coincide con il tipo della variabile ritornata, ma p punta ad x che è una variabile
locale quindi viene restituito un dangling pointer. Non è prevedibile il comportamento della funzione che potrebbe funzionare, come no,
comunque non vengono restituiti errori in compilazione e il main stampa 234. Sia che l'assegnazione **F(q) = *q++ vada a buon fine, che no.
*/
2) enum colori{bianco, nero, giallo, rosso, azzurro}
main(){
for(int x = bianco; x <=azzurro; x = x+1)
switch(x){
case rosso: break;
default: {cout << x << endl;}
}
}
/*Il costruttore enum assegna i valori standard
bianco = 0,
nero = 1,
giallo = 2,
rosso = 3,
azzurro = 4
All'entrata del ciclo for, nella dichiarazione, x vale 0 e, fintanto che non è minore o uguale a 4 viene incrementato.
Successivamente allo switch per i valori 0, 1 e 2 (!= rosso = 3) vengono stampati tali valori, mentre quando x vale 3
(ovvero rosso) si esce dallo switch senza stampare nulla, ma rimanendo sempre all'interno del for che porta, all'ultima
interazione, a stampare il valore 4 (azzurro).*/
3) //PRE F1 = L lista corretta, eventualmente vuota
int F1(nodo *L){
if(L)
return 1+F1(L->next);
return 0;
}
//POST F1 = F1 restituisce il numero di nodi della lista L
//PRE F0 = L lista corretta, eventualmente vuota
int F0(nodo *L){
if(L&&L->next)
return F0(L->next)*F1(L)
return 1;
}
//POST = indicando n come il numero di nodi della lista L, F0 restituisce n! |
/* Webcamoid, webcam capture application.
* Copyright (C) 2016 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid 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 Webcamoid. If not, see <http://www.gnu.org/licenses/>.
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef MEDIAWRITERGSTREAMER_H
#define MEDIAWRITERGSTREAMER_H
#include "mediawriter.h"
class MediaWriterGStreamerPrivate;
class AkAudioPacket;
class AkVideoPacket;
class MediaWriterGStreamer: public MediaWriter
{
Q_OBJECT
public:
MediaWriterGStreamer(QObject *parent=nullptr);
~MediaWriterGStreamer();
Q_INVOKABLE QString defaultFormat();
Q_INVOKABLE QString outputFormat() const;
Q_INVOKABLE QVariantList streams() const;
Q_INVOKABLE QStringList supportedFormats();
Q_INVOKABLE QStringList fileExtensions(const QString &format);
Q_INVOKABLE QString formatDescription(const QString &format);
Q_INVOKABLE QVariantList formatOptions();
Q_INVOKABLE QStringList supportedCodecs(const QString &format);
Q_INVOKABLE QStringList supportedCodecs(const QString &format,
const QString &type);
Q_INVOKABLE QString defaultCodec(const QString &format,
const QString &type);
Q_INVOKABLE QString codecDescription(const QString &codec);
Q_INVOKABLE QString codecType(const QString &codec);
Q_INVOKABLE QVariantMap defaultCodecParams(const QString &codec);
Q_INVOKABLE QVariantMap addStream(int streamIndex,
const AkCaps &streamCaps);
Q_INVOKABLE QVariantMap addStream(int streamIndex,
const AkCaps &streamCaps,
const QVariantMap &codecParams);
Q_INVOKABLE QVariantMap updateStream(int index);
Q_INVOKABLE QVariantMap updateStream(int index,
const QVariantMap &codecParams);
Q_INVOKABLE QVariantList codecOptions(int index);
private:
MediaWriterGStreamerPrivate *d;
public slots:
void setOutputFormat(const QString &outputFormat);
void setFormatOptions(const QVariantMap &formatOptions);
void setCodecOptions(int index, const QVariantMap &codecOptions);
void resetOutputFormat();
void resetFormatOptions();
void resetCodecOptions(int index);
void enqueuePacket(const AkPacket &packet);
void clearStreams();
bool init();
void uninit();
private slots:
void writeAudioPacket(const AkAudioPacket &packet);
void writeVideoPacket(const AkVideoPacket &packet);
void writeSubtitlePacket(const AkPacket &packet);
friend class MediaWriterGStreamerPrivate;
};
#endif // MEDIAWRITERGSTREAMER_H
|
/*
** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $
** Auxiliary functions from Lua API
** See Copyright Notice in lua.h
*/
#ifndef lapi_h
#define lapi_h
#include <lua/lobject.h>
LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o);
#endif
|
/* The PyMem_ family: low-level memory allocation interfaces.
See objimpl.h for the PyObject_ memory family.
*/
#ifndef Py_PYMEM_H
#define Py_PYMEM_H
#include "pyport.h"
#ifdef __cplusplus
extern "C" {
#endif
/* BEWARE:
Each interface exports both functions and macros. Extension modules should
use the functions, to ensure binary compatibility across Python versions.
Because the Python implementation is free to change internal details, and
the macros may (or may not) expose details for speed, if you do use the
macros you must recompile your extensions with each Python release.
Never mix calls to PyMem_ with calls to the platform malloc/realloc/
calloc/free. For example, on Windows different DLLs may end up using
different heaps, and if you use PyMem_Malloc you'll get the memory from the
heap used by the Python DLL; it could be a disaster if you free()'ed that
directly in your own extension. Using PyMem_Free instead ensures Python
can return the memory to the proper heap. As another example, in
PYMALLOC_DEBUG mode, Python wraps all calls to all PyMem_ and PyObject_
memory functions in special debugging wrappers that add additional
debugging info to dynamic memory blocks. The system routines have no idea
what to do with that stuff, and the Python wrappers have no idea what to do
with raw blocks obtained directly by the system routines then.
The GIL must be held when using these APIs.
*/
/*
* Raw memory interface
* ====================
*/
/* Functions
Functions supplying platform-independent semantics for malloc/realloc/
free. These functions make sure that allocating 0 bytes returns a distinct
non-NULL pointer (whenever possible -- if we're flat out of memory, NULL
may be returned), even if the platform malloc and realloc don't.
Returned pointers must be checked for NULL explicitly. No action is
performed on failure (no exception is set, no warning is printed, etc).
*/
PyAPI_FUNC(void *) PyMem_Malloc(size_t);
PyAPI_FUNC(void *) PyMem_Realloc(void *, size_t);
PyAPI_FUNC(void) PyMem_Free(void *);
/* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are
no longer supported. They used to call PyErr_NoMemory() on failure. */
/* Macros. */
#ifdef PYMALLOC_DEBUG
/* Redirect all memory operations to Python's debugging allocator. */
#define PyMem_MALLOC _PyMem_DebugMalloc
#define PyMem_REALLOC _PyMem_DebugRealloc
#define PyMem_FREE _PyMem_DebugFree
#else /* ! PYMALLOC_DEBUG */
/* PyMem_MALLOC(0) means malloc(1). Some systems would return NULL
for malloc(0), which would be treated as an error. Some platforms
would return a pointer with no memory behind it, which would break
pymalloc. To solve these problems, allocate an extra byte. */
/* Returns NULL to indicate error if a negative size or size larger than
Py_ssize_t can represent is supplied. Helps prevents security holes. */
#define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
: malloc(((n) != 0) ? (n) : 1))
#define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
: realloc((p), ((n) != 0) ? (n) : 1))
#define PyMem_FREE free
#endif /* PYMALLOC_DEBUG */
/*
* Type-oriented memory interface
* ==============================
*
* Allocate memory for n objects of the given type. Returns a new pointer
* or NULL if the request was too large or memory allocation failed. Use
* these macros rather than doing the multiplication yourself so that proper
* overflow checking is always done.
*/
#define PyMem_New(type, n) \
( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
( (type *) PyMem_Malloc((n) * sizeof(type)) ) )
#define PyMem_NEW(type, n) \
( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
( (type *) PyMem_MALLOC((n) * sizeof(type)) ) )
/*
* The value of (p) is always clobbered by this macro regardless of success.
* The caller MUST check if (p) is NULL afterwards and deal with the memory
* error if so. This means the original value of (p) MUST be saved for the
* caller's memory error handler to not lose track of it.
*/
#define PyMem_Resize(p, type, n) \
( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
(type *) PyMem_Realloc((p), (n) * sizeof(type)) )
#define PyMem_RESIZE(p, type, n) \
( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
(type *) PyMem_REALLOC((p), (n) * sizeof(type)) )
/* PyMem{Del,DEL} are left over from ancient days, and shouldn't be used
* anymore. They're just confusing aliases for PyMem_{Free,FREE} now.
*/
#define PyMem_Del PyMem_Free
#define PyMem_DEL PyMem_FREE
#ifdef __cplusplus
}
#endif
#endif /* !Py_PYMEM_H */
|
/*
* This file is a part of Xpiks - cross platform application for
* keywording and uploading images for microstocks
* Copyright (C) 2014-2017 Taras Kushnir <kushnirTV@gmail.com>
*
* Xpiks is distributed under the GNU General Public License, version 3.0
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QObject>
#include <QQmlEngine>
#include "../Models/artworkproxybase.h"
#include "../Common/basicmetadatamodel.h"
#include "../SpellCheck/spellcheckiteminfo.h"
#ifndef SPELLCHECKUSERDICT_H
#define SPELLCHECKUSERDICT_H
namespace SpellCheck {
class UserDictEditModel: public QObject, public Models::ArtworkProxyBase
{
Q_OBJECT
Q_PROPERTY(int keywordsCount READ getKeywordsCount NOTIFY keywordsCountChanged)
public:
UserDictEditModel(QObject *parent=0);
virtual ~UserDictEditModel() {}
signals:
void keywordsCountChanged();
protected:
virtual void signalDescriptionChanged() override { /* BUMP */ }
virtual void signalTitleChanged() override { /* BUMP */ }
virtual void signalKeywordsCountChanged() override { emit keywordsCountChanged(); }
public:
Q_INVOKABLE void initializeModel();
Q_INVOKABLE void removeKeywordAt(int keywordIndex);
Q_INVOKABLE void removeLastKeyword();
Q_INVOKABLE void appendKeyword(const QString &keyword);
Q_INVOKABLE void clearKeywords();
Q_INVOKABLE void resetModel();
Q_INVOKABLE QObject *getBasicModel() {
QObject *item = getBasicMetadataModel();
QQmlEngine::setObjectOwnership(item, QQmlEngine::CppOwnership);
return item;
}
Q_INVOKABLE void saveUserDict();
protected:
virtual Common::BasicMetadataModel *getBasicMetadataModel() override { return &m_BasicModel; }
virtual Common::IMetadataOperator *getMetadataOperator() override { return &m_BasicModel; }
private:
Common::Hold m_HoldPlaceholder;
Common::BasicMetadataModel m_BasicModel;
SpellCheck::SpellCheckItemInfo m_SpellCheckInfo;
};
}
#endif // SPELLCHECKUSERDICT_H
|
/*
* Copyright (C) Tildeslash Ltd. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
*
* 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/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations
* including the two.
*
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL.
*/
#ifndef STRINGBUFFER_INCLUDED
#define STRINGBUFFER_INCLUDED
#include <stdarg.h>
/**
* A <b>String Buffer</b> implements a mutable sequence of characters.
*
* @file
*/
#define T StringBuffer_T
typedef struct T *T;
/**
* Constructs a string buffer so that it represents the same sequence of
* characters as the string argument; in other words, the initial contents
* of the string buffer is a copy of the argument string.
* @param s the initial contents of the buffer
* @return A new StringBuffer object
*/
T StringBuffer_new(const char *s);
/**
* Factory method, create an empty string buffer
* @param hint The initial capacity of the buffer in bytes (hint > 0)
* @return A new StringBuffer object
* @exception AssertException if hint is less than or equal to 0
* @exception MemoryException if allocation failed
*/
T StringBuffer_create(int hint);
/**
* Destroy a StringBuffer object and free allocated resources
* @param S a StringBuffer object reference
*/
void StringBuffer_free(T *S);
/**
* The characters of the String argument are appended, in order, to the
* contents of this string buffer, increasing the length of this string
* buffer by the length of the arguments.
* @param S StringBuffer object
* @param s A string with optional var args
* @return A reference to this StringBuffer
*/
T StringBuffer_append(T S, const char *s, ...) __attribute__((format (printf, 2, 3)));
/**
* The characters of the String argument are appended, in order, to the
* contents of this string buffer, increasing the length of this string
* buffer by the length of the arguments.
* @param S StringBuffer object
* @param s A string with optional var args
* @param ap A variable argument list
* @return A reference to this StringBuffer
*/
T StringBuffer_vappend(T S, const char *s, va_list ap);
/**
* Returns the length (character count) of this string buffer.
* @param S StringBuffer object
* @return The length of the sequence of characters currently represented
* by this string buffer
*/
int StringBuffer_length(T S);
/**
* Clear the contents of the string buffer. I.e. set buffer length to 0.
* @param S StringBuffer object
* @return a reference to this StringBuffer
*/
T StringBuffer_clear(T S);
/**
* Converts to a string representing the data in this string buffer.
* @param S StringBuffer object
* @return A string representation of the string buffer
*/
const char *StringBuffer_toString(T S);
/**
* Replace all occurences of <code>?</code> in this string buffer with <code>$n</code>.
* Example:
* <pre>
* StringBuffer_T b = StringBuffer_new("insert into host values(?, ?, ?);");
* StringBuffer_prepare4postgres(b) -> "insert into host values($1, $2, $3);"
* </pre>
* @param S StringBuffer object
* @return The number of replacements that took place
* @exception SQLException if there are more than 99 wild card '?' parameters
*/
int StringBuffer_prepare4postgres(T S);
/**
* Replace all occurences of <code>?</code> in this string buffer with <code>:n</code>.
* Example:
* <pre>
* StringBuffer_T b = StringBuffer_new("insert into host values(?, ?, ?);");
* StringBuffer_prepare4oracle(b) -> "insert into host values(:1, :2, :3);"
* </pre>
* @param S StringBuffer object
* @return The number of replacements that took place
* @exception SQLException if there are more than 99 wild card '?' parameters
*/
int StringBuffer_prepare4oracle(T S);
/**
* Remove (any) leading and trailing white space and semicolon [ \\t\\r\\n;]. Example
* <pre>
* StringBuffer_T b = StringBuffer_new("\t select a from b; \n");
* StringBuffer_trim(b) -> "select a from b"
* </pre>
* @param S StringBuffer object
* @return a reference to this StringBuffer
*/
T StringBuffer_trim(T S);
#undef T
#endif
|
/*
* Copyright 2013 Kristian Evensen <kristian.evensen@gmail.com>
*
* This file is part of Multi Network Manager (MNM). MNM is free software: you
* can redistribute it and/or modify it under the terms of the Lesser GNU
* General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* MNM 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
* Network Device Listener. If not, see http://www.gnu.org/licenses/.
*/
#ifndef MULTI_COMMON_H
#define MULTI_COMMON_H
#define MAX_BUFSIZE 1500
typedef enum{
//Initial state, link cannot be used (can still be up and running)
LINK_DOWN=0,
//Link is ready and can be used
LINK_UP,
//Signal that information about the PPP interface must be collected. Needed to restore state, because of non-working nested wilddump/filter
LINK_DOWN_PPP,
//Signal that information about a wireless ap interface must be collected
LINK_DOWN_AP,
//Link has lost its current IP address and cant be used
LINK_INVALID,
//If DHCP is to be used on this link, indicates that link is waiting for DHCP to finish
WAITING_FOR_DHCP,
//DHCP has finished successfully, info store in cfg and the main thread will configure interface
GOT_IP_DHCP,
//Static IP, interface is up, but not running (so no cable attached)
GOT_IP_STATIC_UP,
//Has a static IP address
GOT_IP_STATIC,
//This is a PPP interface, which will be given an IP automaticually
GOT_IP_PPP,
//Got the information about the wireless access point interface
GOT_IP_AP,
//DHCP failed, the application will ignore this interface forever (for now).
//TODO: Decide if it should be freed.
DHCP_FAILED,
//DHCP got a new IP after a RENEW/REBIND, must first flush then add new info
DHCP_IP_CHANGED,
//DHCP lease has expired and a new IP has not been received. This does not
//mean that the interface is down, but it cant be used!
DHCP_IP_INVALID,
//Interface is up, but not active (i.e., no cable)
LINK_UP_STATIC_IFF,
//Link is up and with a static IP (used to avoid seg fault when link goes
//down!)
LINK_UP_STATIC,
//Same as above, but for PPP
LINK_UP_PPP,
//Access point is up and configured
LINK_UP_AP,
//Interface has previously been allocated an IP, try to reuse that one
REBOOT_DHCP,
//The link module has marked this link for deletion (needed because
//g_slist_foreach is not safe)
DELETE_LINK
} link_state;
#define MULTI_LOG_PREFIX "[%d:%d:%d %d/%d/%d %s:%d]: "
#define MULTI_LOG_PREFIX_ARG __FILE__, __LINE__
#define MULTI_DEBUG_PRINT2(fd, ...){fprintf(fd, __VA_ARGS__);fflush(fd);}
//The ## is there so that I dont have to fake an argument when I use the macro
//on string without arguments!
#define MULTI_DEBUG_PRINT(fd, _fmt, ...){ \
time_t rawtime; \
struct tm *curtime; \
time(&rawtime); \
curtime = gmtime(&rawtime); \
MULTI_DEBUG_PRINT2(fd, MULTI_LOG_PREFIX _fmt, curtime->tm_hour, \
curtime->tm_min, curtime->tm_sec, curtime->tm_mday, \
curtime->tm_mon + 1, 1900 + curtime->tm_year, \
MULTI_LOG_PREFIX_ARG, ##__VA_ARGS__);}
#endif
|
/**
* \file timers.h
* \brief OS Soft Timers service functions
*
* Functions to create, start, stop, delete and
* get remaining time of soft timers
*
**/
/*********************************************************************************************************
* BRTOS
* Brazilian Real-Time Operating System
* Acronymous of Basic Real-Time Operating System
*
*
* Open Source RTOS under MIT License
*
*
*
* OS Soft Timers functions
*
*
* Authors: Carlos Henrique Barriquelo
* Revision: 1.0
* Date: 12/01/2013
* Revision: 1.02 (Support for task handle)
* Date: 22/11/2014
*********************************************************************************************************/
/*****************************************************************/
/* OS SOFT TIMER */
/*****************************************************************/
#ifndef TIMERS_H
#define TIMERS_H
#include "BRTOS.h"
#ifdef BRTOS_TMR_EN
#if (BRTOS_TMR_EN == 1)
/// Defines the maximum number of timers by default
/// Limits the memory allocation for timers
#define BRTOS_MAX_TIMER_DEFAULT 8
#ifndef BRTOS_MAX_TIMER
#define BRTOS_MAX_TIMER BRTOS_MAX_TIMER_DEFAULT
#endif
/* config defines */
// do not change, unless we know what are you doing
#define TIMER_CNT INT16U
#define TIMER_MAX_COUNTER (TIMER_CNT)(TICK_COUNT_OVERFLOW-1)
/* typedefs for callback struct */
typedef TIMER_CNT (*FCN_CALLBACK) (void);
/* soft timer possible states:
*/
typedef enum{
TIMER_NOT_ALLOCATED = 0,
TIMER_NOT_USED = 1,
TIMER_STOPPED = 2,
TIMER_RUNNING = 3,
} TIMER_STATE;
/* soft timer data struct
*/
typedef struct BRTOS_TIMER_S {
FCN_CALLBACK func_cb;
TIMER_CNT timeout;
TIMER_STATE state;
} BRTOS_TIMER_T;
/* soft timer typedef
*/
typedef BRTOS_TIMER_T* BRTOS_TIMER;
/* soft timers list data struct
*/
typedef struct{
BRTOS_TIMER timers [BRTOS_MAX_TIMER];
INT8S count;
}BRTOS_TMR_T;
/* TIMER TASK prototype */
#if (TASK_WITH_PARAMETERS == 1)
void BRTOS_TimerTask(void *param);
#else
void BRTOS_TimerTask(void);
#endif
/************* public API *********************/
void OSTimerInit(INT16U timertask_stacksize, INT8U prio);
INT8U OSTimerSet (BRTOS_TIMER *cbp, FCN_CALLBACK cb, TIMER_CNT timeout);
TIMER_CNT OSTimerGet (BRTOS_TIMER p);
INT8U OSTimerStart (BRTOS_TIMER p, TIMER_CNT timeout);
INT8U OSTimerStop (BRTOS_TIMER p, INT8U del);
/***************************************/
#endif
#endif
/*****************************************************************/
/* OS SOFT TIMER EOF */
/*****************************************************************/
#endif
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
/*
puredocparser.h
*/
#ifndef PUREDOCPARSER_H
#define PUREDOCPARSER_H
#include <qset.h>
#include "cppcodeparser.h"
#include "location.h"
QT_BEGIN_NAMESPACE
class Config;
class Node;
class QString;
class PureDocParser : public CppCodeParser
{
Q_DECLARE_TR_FUNCTIONS(QDoc::PureDocParser)
public:
PureDocParser();
virtual ~PureDocParser();
virtual QStringList sourceFileNameFilter() Q_DECL_OVERRIDE;
virtual void parseSourceFile(const Location& location, const QString& filePath) Q_DECL_OVERRIDE;
private:
bool processQdocComments();
};
QT_END_NAMESPACE
#endif
|
/* kernel.h
*
* Copyright (c) 2009-2013 Brown Deer Technology, LLC. All Rights Reserved.
*
* This software was developed by Brown Deer Technology, LLC.
* For more information contact info@browndeertechnology.com
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3 (LGPLv3)
* 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, see <http://www.gnu.org/licenses/>.
*/
/* DAR */
#ifndef _kernel_h
#define _kernel_h
#include "coprthr_program.h"
void __do_create_kernel_1(struct coprthr_kernel* krn1 );
int __do_set_kernel_arg_1( struct coprthr_kernel* krn1, unsigned int argn,
size_t arg_sz, const void* arg_val);
#endif
|
/*
* Controller.h: An application to demonstrate GNUstep toolbars
*
* Copyright (c) 2004 Free Software Foundation, Inc.
*
* Author: Quentin Mathe <qmathe@club-internet.fr>
* Date: September 2004
*
* This sample program is part of GNUstep.
*
* 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 <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
@interface Controller : NSObject
{
}
@end
|
/*
* io_table.c
*
*/
#include <avr/io.h>
#include "global.h"
#include "config.h"
#include "io_table.h"
// logical input to physical IO port mapping
// V2.x hardware
#ifndef HARDWARE_V1
#define IO_TABLE \
ENTRY(PB16, &PORTA, PIN0_bm) \
ENTRY(PB15, &PORTA, PIN1_bm) \
ENTRY(PB14, &PORTA, PIN2_bm) \
ENTRY(PB13, &PORTA, PIN3_bm) \
ENTRY(PB12, &PORTA, PIN4_bm) \
ENTRY(PB11, &PORTA, PIN5_bm) \
ENTRY(PB10, &PORTA, PIN6_bm) \
ENTRY(PB9, &PORTA, PIN7_bm) \
\
ENTRY(PB8, &PORTB, PIN0_bm) \
ENTRY(PB7, &PORTB, PIN1_bm) \
ENTRY(PB6, &PORTB, PIN2_bm) \
ENTRY(PB5, &PORTB, PIN3_bm) \
ENTRY(PB4, &PORTB, PIN4_bm) \
ENTRY(PB3, &PORTB, PIN5_bm) \
ENTRY(PB2, &PORTB, PIN6_bm) \
ENTRY(PB1, &PORTB, PIN7_bm) \
\
ENTRY(PJOY_UP, &PORTC, PIN4_bm) \
ENTRY(PJOY_DN, &PORTC, PIN5_bm) \
ENTRY(PJOY_LF, &PORTC, PIN6_bm) \
ENTRY(PJOY_RT, &PORTC, PIN7_bm) \
\
ENTRY(PMETA, &PORTD, PIN0_bm) \
ENTRY(PLED, &PORTD, PIN1_bm) \
ENTRY(PA4, &PORTD, PIN2_bm) \
ENTRY(PA3, &PORTD, PIN3_bm) \
ENTRY(PA2, &PORTD, PIN4_bm) \
ENTRY(PA1, &PORTD, PIN5_bm) \
\
ENTRY(PA8, &PORTE, PIN0_bm) \
ENTRY(PA7, &PORTE, PIN1_bm) \
ENTRY(PA6, &PORTE, PIN2_bm) \
ENTRY(PA5, &PORTE, PIN3_bm) \
ENTRY(PR4, &PORTE, PIN4_bm) \
ENTRY(PR3, &PORTE, PIN5_bm) \
ENTRY(PR2, &PORTE, PIN6_bm) \
ENTRY(PR1, &PORTE, PIN7_bm) \
\
ENTRY(PR8, &PORTF, PIN0_bm) \
ENTRY(PR7, &PORTF, PIN1_bm) \
ENTRY(PR6, &PORTF, PIN2_bm) \
ENTRY(PR5, &PORTF, PIN3_bm) \
ENTRY(PA12, &PORTF, PIN4_bm) \
ENTRY(PA11, &PORTF, PIN5_bm) \
ENTRY(PA10, &PORTF, PIN6_bm) \
ENTRY(PA9, &PORTF, PIN7_bm)
#else
// V1.x hardware
#define IO_TABLE \
ENTRY(PJOY_UP, &PORTA, PIN0_bm) \
ENTRY(PJOY_DN, &PORTA, PIN1_bm) \
ENTRY(PJOY_LF, &PORTA, PIN2_bm) \
ENTRY(PJOY_RT, &PORTA, PIN3_bm) \
ENTRY(PB16, &PORTA, PIN4_bm) \
ENTRY(PB15, &PORTA, PIN5_bm) \
ENTRY(PA5, &PORTA, PIN6_bm) \
ENTRY(PA6, &PORTA, PIN7_bm) \
\
ENTRY(PB1, &PORTB, PIN0_bm) \
ENTRY(PB2, &PORTB, PIN1_bm) \
ENTRY(PB3, &PORTB, PIN2_bm) \
ENTRY(PB4, &PORTB, PIN3_bm) \
ENTRY(PB5, &PORTB, PIN4_bm) \
ENTRY(PB6, &PORTB, PIN5_bm) \
ENTRY(PB7, &PORTB, PIN6_bm) \
ENTRY(PB8, &PORTB, PIN7_bm) \
\
ENTRY(PA1, &PORTC, PIN1_bm) \
ENTRY(PA2, &PORTC, PIN2_bm) \
ENTRY(PA3, &PORTC, PIN3_bm) \
ENTRY(PA4, &PORTC, PIN4_bm) \
\
ENTRY(PA7, &PORTD, PIN0_bm) \
ENTRY(PA8, &PORTD, PIN1_bm) \
ENTRY(PA9, &PORTD, PIN2_bm) \
ENTRY(PA10, &PORTD, PIN3_bm) \
ENTRY(PA11, &PORTD, PIN4_bm) \
ENTRY(PA12, &PORTD, PIN5_bm) \
\
ENTRY(PR12, &PORTE, PIN0_bm) \
ENTRY(PR11, &PORTE, PIN1_bm) \
ENTRY(PR10, &PORTE, PIN2_bm) \
ENTRY(PR9, &PORTE, PIN3_bm) \
ENTRY(PR8, &PORTE, PIN4_bm) \
ENTRY(PR7, &PORTE, PIN5_bm) \
ENTRY(PR6, &PORTE, PIN6_bm) \
ENTRY(PR5, &PORTE, PIN7_bm) \
\
ENTRY(PR4, &PORTF, PIN0_bm) \
ENTRY(PR3, &PORTF, PIN1_bm) \
ENTRY(PR2, &PORTF, PIN2_bm) \
ENTRY(PR1, &PORTF, PIN3_bm) \
ENTRY(PB14, &PORTF, PIN4_bm) \
ENTRY(PA13, &PORTF, PIN5_bm) \
ENTRY(PA12, &PORTF, PIN6_bm) \
ENTRY(PMETA, &PORTF, PIN7_bm)
#endif
const __flash IO_PIN_t io_pin_table[256] = {
#define ENTRY(name, port, pin_mask) [name] = {port, pin_mask},
IO_TABLE
#undef ENTRY
};
|
/*
Copyright 2013-2014 Jan Grulich <jgrulich@redhat.com>
Copyright 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef HAWAII_NM_MODEL_NETWORK_MODEL_ITEM_H
#define HAWAII_NM_MODEL_NETWORK_MODEL_ITEM_H
#include <NetworkManagerQt/ActiveConnection>
#include <NetworkManagerQt/Connection>
#include <NetworkManagerQt/ConnectionSettings>
#include <NetworkManagerQt/Device>
#include <NetworkManagerQt/Utils>
#include "networkmodel.h"
class Q_DECL_EXPORT NetworkModelItem : public QObject
{
Q_OBJECT
public:
enum ItemType { UnavailableConnection, AvailableConnection, AvailableAccessPoint, AvailableNsp };
explicit NetworkModelItem(QObject * parent = 0);
explicit NetworkModelItem(const NetworkModelItem * item, QObject* parent = 0);
virtual ~NetworkModelItem();
QString activeConnectionPath() const;
void setActiveConnectionPath(const QString& path);
QString connectionPath() const;
void setConnectionPath(const QString& path);
NetworkManager::ActiveConnection::State connectionState() const;
void setConnectionState(NetworkManager::ActiveConnection::State state);
QStringList details() const;
QString deviceName() const;
void setDeviceName(const QString& name);
QString devicePath() const;
void setDevicePath(const QString& path);
QString deviceState() const;
void setDeviceState(const NetworkManager::Device::State state);
bool duplicate() const;
QString icon() const;
ItemType itemType() const;
NetworkManager::WirelessSetting::NetworkMode mode() const;
void setMode(const NetworkManager::WirelessSetting::NetworkMode mode);
QString name() const;
void setName(const QString& name);
QString nsp() const;
void setNsp(const QString& nsp);
QString originalName() const;
QString sectionType() const;
NetworkManager::WirelessSecurityType securityType() const;
void setSecurityType(NetworkManager::WirelessSecurityType type);
int signal() const;
void setSignal(int signal);
bool slave() const;
void setSlave(bool slave);
QString specificPath() const;
void setSpecificPath(const QString& path);
QString ssid() const;
void setSsid(const QString& ssid);
QDateTime timestamp() const;
void setTimestamp(const QDateTime& date);
NetworkManager::ConnectionSettings::ConnectionType type() const;
void setType(NetworkManager::ConnectionSettings::ConnectionType type);
QString uni() const;
QString uuid() const;
void setUuid(const QString& uuid);
QString vpnState() const;
void setVpnState(NetworkManager::VpnConnection::State state);
bool operator==(const NetworkModelItem * item) const;
public Q_SLOTS:
void updateDetails();
private:
QString m_activeConnectionPath;
QString m_connectionPath;
NetworkManager::ActiveConnection::State m_connectionState;
QString m_devicePath;
QString m_deviceName;
NetworkManager::Device::State m_deviceState;
QStringList m_details;
bool m_duplicate;
NetworkManager::WirelessSetting::NetworkMode m_mode;
QString m_name;
QString m_nsp;
NetworkManager::WirelessSecurityType m_securityType;
int m_signal;
bool m_slave;
QString m_specificPath;
QString m_ssid;
QDateTime m_timestamp;
NetworkManager::ConnectionSettings::ConnectionType m_type;
QString m_uuid;
NetworkManager::VpnConnection::State m_vpnState;
};
#endif // HAWAII_NM_MODEL_NETWORK_MODEL_ITEM_H
|
/*
* Copyright 2007 The Android Open Source Project
*
* General purpose hash table, used for finding classes, methods, etc.
*
* When the number of elements reaches 3/4 of the table's capacity, the
* table will be resized.
*/
#ifndef _MINZIP_HASH
#define _MINZIP_HASH
#include "inline_magic.h"
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#ifdef __cplusplus
extern "C" {
#endif
/* compute the hash of an item with a specific type */
typedef unsigned int (*HashCompute)(const void* item);
/*
* Compare a hash entry with a "loose" item after their hash values match.
* Returns { <0, 0, >0 } depending on ordering of items (same semantics
* as strcmp()).
*/
typedef int (*HashCompareFunc)(const void* tableItem, const void* looseItem);
/*
* This function will be used to free entries in the table. This can be
* NULL if no free is required, free(), or a custom function.
*/
typedef void (*HashFreeFunc)(void* ptr);
/*
* Used by mzHashForeach().
*/
typedef int (*HashForeachFunc)(void* data, void* arg);
/*
* One entry in the hash table. "data" values are expected to be (or have
* the same characteristics as) valid pointers. In particular, a NULL
* value for "data" indicates an empty slot, and HASH_TOMBSTONE indicates
* a no-longer-used slot that must be stepped over during probing.
*
* Attempting to add a NULL or tombstone value is an error.
*
* When an entry is released, we will call (HashFreeFunc)(entry->data).
*/
typedef struct HashEntry {
unsigned int hashValue;
void* data;
} HashEntry;
#define HASH_TOMBSTONE ((void*) 0xcbcacccd) // invalid ptr value
/*
* Expandable hash table.
*
* This structure should be considered opaque.
*/
typedef struct HashTable {
int tableSize; /* must be power of 2 */
int numEntries; /* current #of "live" entries */
int numDeadEntries; /* current #of tombstone entries */
HashEntry* pEntries; /* array on heap */
HashFreeFunc freeFunc;
} HashTable;
/*
* Create and initialize a HashTable structure, using "initialSize" as
* a basis for the initial capacity of the table. (The actual initial
* table size may be adjusted upward.) If you know exactly how many
* elements the table will hold, pass the result from mzHashSize() in.)
*
* Returns "false" if unable to allocate the table.
*/
HashTable* mzHashTableCreate(size_t initialSize, HashFreeFunc freeFunc);
/*
* Compute the capacity needed for a table to hold "size" elements. Use
* this when you know ahead of time how many elements the table will hold.
* Pass this value into mzHashTableCreate() to ensure that you can add
* all elements without needing to reallocate the table.
*/
size_t mzHashSize(size_t size);
/*
* Clear out a hash table, freeing the contents of any used entries.
*/
void mzHashTableClear(HashTable* pHashTable);
/*
* Free a hash table.
*/
void mzHashTableFree(HashTable* pHashTable);
/*
* Get #of entries in hash table.
*/
INLINE int mzHashTableNumEntries(HashTable* pHashTable) {
return pHashTable->numEntries;
}
/*
* Get total size of hash table (for memory usage calculations).
*/
INLINE int mzHashTableMemUsage(HashTable* pHashTable) {
return sizeof(HashTable) + pHashTable->tableSize * sizeof(HashEntry);
}
/*
* Look up an entry in the table, possibly adding it if it's not there.
*
* If "item" is not found, and "doAdd" is false, NULL is returned.
* Otherwise, a pointer to the found or added item is returned. (You can
* tell the difference by seeing if return value == item.)
*
* An "add" operation may cause the entire table to be reallocated.
*/
void* mzHashTableLookup(HashTable* pHashTable, unsigned int itemHash, void* item,
HashCompareFunc cmpFunc, bool doAdd);
/*
* Remove an item from the hash table, given its "data" pointer. Does not
* invoke the "free" function; just detaches it from the table.
*/
bool mzHashTableRemove(HashTable* pHashTable, unsigned int hash, void* item);
/*
* Execute "func" on every entry in the hash table.
*
* If "func" returns a nonzero value, terminate early and return the value.
*/
int mzHashForeach(HashTable* pHashTable, HashForeachFunc func, void* arg);
/*
* An alternative to mzHashForeach(), using an iterator.
*
* Use like this:
* HashIter iter;
* for (mzHashIterBegin(hashTable, &iter); !mzHashIterDone(&iter);
* mzHashIterNext(&iter))
* {
* MyData* data = (MyData*)mzHashIterData(&iter);
* }
*/
typedef struct HashIter {
void* data;
HashTable* pHashTable;
int idx;
} HashIter;
INLINE void mzHashIterNext(HashIter* pIter) {
int i = pIter->idx +1;
int lim = pIter->pHashTable->tableSize;
for ( ; i < lim; i++) {
void* data = pIter->pHashTable->pEntries[i].data;
if (data != NULL && data != HASH_TOMBSTONE)
break;
}
pIter->idx = i;
}
INLINE void mzHashIterBegin(HashTable* pHashTable, HashIter* pIter) {
pIter->pHashTable = pHashTable;
pIter->idx = -1;
mzHashIterNext(pIter);
}
INLINE bool mzHashIterDone(HashIter* pIter) {
return (pIter->idx >= pIter->pHashTable->tableSize);
}
INLINE void* mzHashIterData(HashIter* pIter) {
assert(pIter->idx >= 0 && pIter->idx < pIter->pHashTable->tableSize);
return pIter->pHashTable->pEntries[pIter->idx].data;
}
/*
* Evaluate hash table performance by examining the number of times we
* have to probe for an entry.
*
* The caller should lock the table beforehand.
*/
typedef unsigned int (*HashCalcFunc)(const void* item);
void mzHashTableProbeCount(HashTable* pHashTable, HashCalcFunc calcFunc,
HashCompareFunc cmpFunc);
#ifdef __cplusplus
}
#endif
#endif /*_MINZIP_HASH*/
|
#ifndef _SIMPLE_FORWARD_SHADER_H
#define _SIMPLE_FORWARD_SHADER_H
class tSimpleForwardShader : public tFaceShader
{
private:
GLint transformation_uniform;
GLint color_uniform;
GLint tex_enabled_uniform;
GLint tex_uniform;
public:
tSimpleForwardShader(void);
void SetColor(tVector color, float alpha);
void SetTexture(bool enabled, GLuint tex = 0);
void SetTransformation(const float m[16]);
};
#endif
|
//
// OTRDemoChatViewController.h
// Off the Record
//
// Created by David on 10/21/13.
// Copyright (c) 2013 Chris Ballinger. All rights reserved.
//
#import "OTRChatViewController.h"
@interface OTRDemoChatViewController : OTRChatViewController
@end
|
////////////////////////////////////////////////////////////////
//
// Copyright (C) 2005 Affymetrix, Inc.
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License
// (version 2.1) as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
// for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////
#pragma once
#include "resource.h" // main symbols
#include "affx_fusion_com.h"
#include "file/CHPFileData.h"
// CBackgroundZoneTypeCOM
class ATL_NO_VTABLE CBackgroundZoneTypeCOM :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CBackgroundZoneTypeCOM, &CLSID_BackgroundZoneType>,
public ISupportErrorInfo,
public IDispatchImpl<IBackgroundZoneType, &IID_IBackgroundZoneType, &LIBID_affx_fusion_comLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
{
public:
CBackgroundZoneTypeCOM()
{
}
DECLARE_REGISTRY_RESOURCEID(IDR_BACKGROUNDZONETYPE)
BEGIN_COM_MAP(CBackgroundZoneTypeCOM)
COM_INTERFACE_ENTRY(IBackgroundZoneType)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()
// ISupportsErrorInfo
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease()
{
}
private:
affxchp::BackgroundZoneType bg;
public:
void SetBg(affxchp::BackgroundZoneType b) { bg = b; }
public:
STDMETHOD(get_centerx)(float* pVal);
public:
STDMETHOD(get_centery)(float* pVal);
public:
STDMETHOD(get_background)(float* pVal);
};
OBJECT_ENTRY_AUTO(__uuidof(BackgroundZoneType), CBackgroundZoneTypeCOM)
|
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE 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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#ifndef JUCE_TOOLTIPWINDOW_H_INCLUDED
#define JUCE_TOOLTIPWINDOW_H_INCLUDED
//==============================================================================
/**
A window that displays a pop-up tooltip when the mouse hovers over another component.
To enable tooltips in your app, just create a single instance of a TooltipWindow
object. Note that if you instantiate more than one instance of this class, you'll
end up with multiple tooltips being shown!
The TooltipWindow object will then stay invisible, waiting until the mouse
hovers for the specified length of time - it will then see if it's currently
over a component which implements the TooltipClient interface, and if so,
it will make itself visible to show the tooltip in the appropriate place.
@see TooltipClient, SettableTooltipClient
*/
class JUCE_API TooltipWindow : public Component,
private Timer
{
public:
//==============================================================================
/** Creates a tooltip window.
Make sure your app only creates one instance of this class, otherwise you'll
get multiple overlaid tooltips appearing. The window will initially be invisible
and will make itself visible when it needs to display a tip.
To change the style of tooltips, see the LookAndFeel class for its tooltip
methods.
@param parentComponent if set to 0, the TooltipWindow will appear on the desktop,
otherwise the tooltip will be added to the given parent
component.
@param millisecondsBeforeTipAppears the time for which the mouse has to stay still
before a tooltip will be shown
@see TooltipClient, LookAndFeel::drawTooltip, LookAndFeel::getTooltipBounds
*/
explicit TooltipWindow (Component* parentComponent = nullptr,
int millisecondsBeforeTipAppears = 700);
/** Destructor. */
~TooltipWindow();
//==============================================================================
/** Changes the time before the tip appears.
This lets you change the value that was set in the constructor.
*/
void setMillisecondsBeforeTipAppears (int newTimeMs = 700) noexcept;
/** Can be called to manually force a tip to be shown at a particular location. */
void displayTip (Point<int> screenPosition, const String& text);
/** Can be called to manually hide the tip if it's showing. */
void hideTip();
//==============================================================================
/** A set of colour IDs to use to change the colour of various aspects of the tooltip.
These constants can be used either via the Component::setColour(), or LookAndFeel::setColour()
methods.
@see Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
*/
enum ColourIds
{
backgroundColourId = 0x1001b00, /**< The colour to fill the background with. */
textColourId = 0x1001c00, /**< The colour to use for the text. */
outlineColourId = 0x1001c10 /**< The colour to use to draw an outline around the tooltip. */
};
//==============================================================================
/** This abstract base class is implemented by LookAndFeel classes to provide
window drawing functionality.
*/
struct JUCE_API LookAndFeelMethods
{
virtual ~LookAndFeelMethods() {}
/** returns the bounds for a tooltip at the given screen coordinate, constrained within the given desktop area. */
virtual Rectangle<int> getTooltipBounds (const String& tipText, Point<int> screenPos, Rectangle<int> parentArea) = 0;
virtual void drawTooltip (Graphics&, const String& text, int width, int height) = 0;
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// This method has been replaced by getTooltipBounds()
virtual int getTooltipSize (const String&, int&, int&) { return 0; }
#endif
};
private:
//==============================================================================
Point<float> lastMousePos;
Component* lastComponentUnderMouse;
String tipShowing, lastTipUnderMouse;
int millisecondsBeforeTipAppears;
int mouseClicks, mouseWheelMoves;
unsigned int lastCompChangeTime, lastHideTime;
bool reentrant;
void paint (Graphics&) override;
void mouseEnter (const MouseEvent&) override;
void timerCallback() override;
void updatePosition (const String&, Point<int>, Rectangle<int>);
static String getTipFor (Component*);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TooltipWindow)
};
#endif // JUCE_TOOLTIPWINDOW_H_INCLUDED
|
/* Generated automatically. DO NOT EDIT! */
#define SIMD_HEADER "simd-avx2.h"
#include "../common/n2bv_8.c"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.