text
stringlengths 4
6.14k
|
|---|
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#ifndef __FIFO_PLAYER_DLG_h__
#define __FIFO_PLAYER_DLG_h__
#include <vector>
#include <wx/wx.h>
#include <wx/notebook.h>
class wxSpinCtrl;
class wxSpinEvent;
class FifoPlayerDlg : public wxDialog
{
public:
FifoPlayerDlg(wxWindow* parent);
~FifoPlayerDlg();
private:
void CreateGUIControls();
void OnPaint( wxPaintEvent& event );
void OnFrameFrom( wxSpinEvent& event );
void OnFrameTo( wxSpinEvent& event );
void OnObjectFrom( wxSpinEvent& event );
void OnObjectTo( wxSpinEvent& event );
void OnCheckEarlyMemoryUpdates( wxCommandEvent& event );
void OnRecordStop( wxCommandEvent& event );
void OnSaveFile( wxCommandEvent& event );
void OnNumFramesToRecord( wxSpinEvent& event );
void OnCloseClick( wxCommandEvent& event );
void OnBeginSearch(wxCommandEvent& event);
void OnFindNextClick(wxCommandEvent& event);
void OnFindPreviousClick(wxCommandEvent& event);
void OnSearchFieldTextChanged(wxCommandEvent& event);
void ChangeSearchResult(unsigned int result_idx);
void ResetSearch();
void OnRecordingFinished(wxEvent& event);
void OnFrameWritten(wxEvent& event);
void OnFrameListSelectionChanged(wxCommandEvent& event);
void OnObjectListSelectionChanged(wxCommandEvent& event);
void OnObjectCmdListSelectionChanged(wxCommandEvent& event);
void OnObjectCmdListSelectionCopy(wxCommandEvent& WXUNUSED(event));
void UpdatePlayGui();
void UpdateRecorderGui();
void UpdateAnalyzerGui();
wxString CreateFileFrameCountLabel() const;
wxString CreateCurrentFrameLabel() const;
wxString CreateFileObjectCountLabel() const;
wxString CreateRecordingFifoSizeLabel() const;
wxString CreateRecordingMemSizeLabel() const;
wxString CreateRecordingFrameCountLabel() const;
wxString CreateIntegerLabel(int size, const wxString& label) const;
bool GetSaveButtonEnabled() const;
// Called from a non-GUI thread
static void RecordingFinished();
static void FileLoaded();
static void FrameWritten();
static wxEvtHandler *volatile m_EvtHandler;
wxNotebook* m_Notebook;
wxPanel* m_PlayPage;
wxStaticText* m_NumFramesLabel;
wxStaticText* m_CurrentFrameLabel;
wxStaticText* m_NumObjectsLabel;
wxStaticText* m_FrameFromLabel;
wxSpinCtrl* m_FrameFromCtrl;
wxStaticText* m_FrameToLabel;
wxSpinCtrl* m_FrameToCtrl;
wxStaticText* m_ObjectFromLabel;
wxSpinCtrl* m_ObjectFromCtrl;
wxStaticText* m_ObjectToLabel;
wxSpinCtrl* m_ObjectToCtrl;
wxCheckBox* m_EarlyMemoryUpdates;
wxPanel* m_RecordPage;
wxStaticText* m_RecordingFifoSizeLabel;
wxStaticText* m_RecordingMemSizeLabel;
wxStaticText* m_RecordingFramesLabel;
wxButton* m_RecordStop;
wxButton* m_Save;
wxStaticText* m_FramesToRecordLabel;
wxSpinCtrl* m_FramesToRecordCtrl;
wxPanel* m_AnalyzePage;
wxListBox* m_framesList;
wxListBox* m_objectsList;
wxListBox* m_objectCmdList;
std::vector<u32> m_objectCmdOffsets;
wxStaticText* m_objectCmdInfo;
wxTextCtrl* m_searchField;
wxButton* m_beginSearch;
wxButton* m_findNext;
wxButton* m_findPrevious;
wxStaticText* m_numResultsText;
struct SearchResult {
int frame_idx;
int obj_idx;
int cmd_idx;
};
std::vector<SearchResult> search_results;
unsigned int m_search_result_idx;
wxButton* m_Close;
s32 m_FramesToRecord;
};
#endif
|
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, [email protected]
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(rattle,FixRattle)
#else
#ifndef LMP_FIX_RATTLE_H
#define LMP_FIX_RATTLE_H
#include "fix.h"
#include "fix_shake.h"
namespace LAMMPS_NS {
class FixRattle : public FixShake {
public:
double **vp; // array for unconstrained velocities
int comm_mode; // mode for communication pack/unpack
double derr_max; // distance error
double verr_max; // velocity error
FixRattle(class LAMMPS *, int, char **);
~FixRattle();
int setmask();
virtual void init();
virtual void post_force(int);
virtual void post_force_respa(int, int, int);
virtual void final_integrate();
virtual void final_integrate_respa(int,int);
virtual void correct_coordinates(int vflag);
virtual void correct_velocities();
virtual void shake_end_of_step(int vflag);
virtual double memory_usage();
virtual void grow_arrays(int);
virtual int pack_forward_comm(int, int *, double *, int, int *);
virtual void unpack_forward_comm(int, int, double *);
virtual void reset_dt();
private:
void update_v_half_nocons();
void update_v_half_nocons_respa(int);
void vrattle2(int m);
void vrattle3(int m);
void vrattle4(int m);
void vrattle3angle(int m);
void solve3x3exactly(const double a[][3], const double c[], double l[]);
void solve2x2exactly(const double a[][2], const double c[], double l[]);
// debugging methods
bool check3angle(double ** v, int m, bool checkr, bool checkv);
bool check2(double **v, int m, bool checkr, bool checkv);
bool check3(double **v, int m, bool checkr, bool checkv);
bool check4(double **v, int m, bool checkr, bool checkv);
bool check_constraints(double **v, bool checkr, bool checkv);
void end_of_step();
};
}
#endif
#endif
/* ERROR/WARNING messages:
W: Fix rattle should come after all other integration fixes
UNDOCUMENTED
E: Rattle determinant = 0.0
The determinant of the matrix being solved for a single cluster
specified by the fix rattle command is numerically invalid.
E: Rattle failed
UNDOCUMENTED
E: Coordinate constraints are not satisfied up to desired tolerance
UNDOCUMENTED
E: Velocity constraints are not satisfied up to desired tolerance
UNDOCUMENTED
E: Velocity constraints are not satisfied up to desired tolerance!
UNDOCUMENTED
U: Fix rattle should come after all other integration fixes
This fix is designed to work after all other integration fixes change
atom positions. Thus it should be the last integration fix specified.
If not, it will not satisfy the desired constraints as well as it
otherwise would.
U: Rattle failed
Certain constraints were not satisfied.
U: Coordinate constraints are not satisfied up to desired tolerance
Self-explanatory.
U: Rattle velocity constraints are not satisfied up to desired tolerance
Self-explanatory.
*/
|
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
* Copyright (C) 2008 Sun Microsystems, Inc.
* Copyright (C) 2010 Joseph Daly
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#pragma once
#include <drizzled/plugin.h>
#include <drizzled/statistics_variables.h>
#include <drizzled/visibility.h>
namespace drizzled {
class DRIZZLED_API StatusHelper
{
public:
static std::string fillHelper(system_status_var*, const char* value, SHOW_TYPE);
static drizzle_show_var status_vars_defs[];
};
} /* namespace drizzled */
|
/* -*- Mode: c; c-basic-offset: 2 -*-
*
* rasqal_prefix.c - Rasqal prefix class
*
* Copyright (C) 2010, David Beckett http://www.dajobe.org/
*
* This package is Free Software and part of Redland http://librdf.org/
*
* It is licensed under the following three licenses as alternatives:
* 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
* 2. GNU General Public License (GPL) V2 or any newer version
* 3. Apache License, V2.0 or any newer version
*
* You may not use this file except in compliance with at least one of
* the above three licenses.
*
* See LICENSE.html or LICENSE.txt at the top of this package for the
* complete terms and further detail along with the license texts for
* the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
*
*
*/
#ifdef HAVE_CONFIG_H
#include <rasqal_config.h>
#endif
#ifdef WIN32
#include <win32_rasqal_config.h>
#endif
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <stdarg.h>
#include "rasqal.h"
#include "rasqal_internal.h"
/**
* rasqal_new_prefix:
* @world: rasqal_world object
* @prefix: Short prefix string to stand for URI (or NULL)
* @uri: Name #raptor_uri.
*
* Constructor - create a new #rasqal_prefix.
* Takes ownership of prefix and uri.
*
* Return value: a new #rasqal_prefix or NULL on failure.
**/
rasqal_prefix*
rasqal_new_prefix(rasqal_world* world, const unsigned char *prefix,
raptor_uri* uri)
{
rasqal_prefix* p;
RASQAL_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, rasqal_world, NULL);
RASQAL_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, raptor_uri, NULL);
p = RASQAL_CALLOC(rasqal_prefix*, 1, sizeof(*p));
if(p) {
p->world = world;
p->prefix = prefix;
p->uri = uri;
} else {
RASQAL_FREE(char*, prefix);
raptor_free_uri(uri);
}
return p;
}
/**
* rasqal_free_prefix:
* @p: #rasqal_prefix object.
*
* Destructor - destroy a #rasqal_prefix object.
**/
void
rasqal_free_prefix(rasqal_prefix* p)
{
if(!p)
return;
if(p->prefix)
RASQAL_FREE(char*, p->prefix);
if(p->uri)
raptor_free_uri(p->uri);
RASQAL_FREE(rasqal_prefix, p);
}
/**
* rasqal_prefix_print:
* @p: #rasqal_prefix object.
* @fh: The FILE* handle to print to.
*
* Print a Rasqal prefix in a debug format.
*
* The print debug format may change in any release.
*
* Return value: non-0 on failure
**/
int
rasqal_prefix_print(rasqal_prefix* p, FILE* fh)
{
RASQAL_ASSERT_OBJECT_POINTER_RETURN_VALUE(p, rasqal_prefix, 1);
RASQAL_ASSERT_OBJECT_POINTER_RETURN_VALUE(fh, FILE*, 1);
fprintf(fh, "prefix(%s as %s)",
(p->prefix ? RASQAL_GOOD_CAST(const char*, p->prefix) : "(default)"),
raptor_uri_as_string(p->uri));
return 0;
}
|
/*
* Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <[email protected]>
* Copyright (C) 2004, 2005 Rob Buis <[email protected]>
* Copyright (C) 2005 Oliver Hunt <[email protected]>
*
* 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.
*/
#pragma once
#include "SVGFELightElement.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
class FEDiffuseLighting;
class SVGColor;
class SVGFEDiffuseLightingElement final : public SVGFilterPrimitiveStandardAttributes {
public:
static Ref<SVGFEDiffuseLightingElement> create(const QualifiedName&, Document&);
void lightElementAttributeChanged(const SVGFELightElement*, const QualifiedName&);
private:
SVGFEDiffuseLightingElement(const QualifiedName&, Document&);
void parseAttribute(const QualifiedName&, const AtomicString&) override;
bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
void svgAttributeChanged(const QualifiedName&) override;
RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
static const AtomicString& kernelUnitLengthXIdentifier();
static const AtomicString& kernelUnitLengthYIdentifier();
BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEDiffuseLightingElement)
DECLARE_ANIMATED_STRING(In1, in1)
DECLARE_ANIMATED_NUMBER(DiffuseConstant, diffuseConstant)
DECLARE_ANIMATED_NUMBER(SurfaceScale, surfaceScale)
DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
END_DECLARE_ANIMATED_PROPERTIES
};
} // namespace WebCore
|
/* Copyright 2017 Rasmus Schults <[email protected]>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "lightsaver.h"
#define KC_F1GL TD(TD_F1_GAME)
#define KC_CLFN TD(TD_CAPS_FN)
enum custom_layers {
BASE, // Base QWERTY layer
FN = 5, // Function layer
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = KEYMAP(\
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_NLCK, KC_INS, KC_HOME, KC_PGUP, KC_PSLS, \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_END, KC_PGDN, KC_PAST, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \
MO(FN), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), \
[FN] = KEYMAP(\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, KC_SLCK, RGB_TOG, RGB_MOD, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_CAPS, BL_TOGG, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), \
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
return MACRO_NONE;
};
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2012 The Chromium OS Authors. 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 as
* published by the Free Software Foundation; version 2 of
* the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <stdint.h>
#include <stdlib.h>
#include <cpu/cpu.h>
#include <cpu/x86/msr.h>
#include <cpu/intel/speedstep.h>
#include "model_2065x.h"
/* MSR Documentation based on
* "Sandy Bridge Processor Family BIOS Writer's Guide (BWG)"
* Document Number 504790
* Revision 1.6.0, June 2012 */
static void msr_set_bit(unsigned int reg, unsigned int bit)
{
msr_t msr = rdmsr(reg);
if (bit < 32) {
if (msr.lo & (1 << bit))
return;
msr.lo |= 1 << bit;
} else {
if (msr.hi & (1 << (bit - 32)))
return;
msr.hi |= 1 << (bit - 32);
}
wrmsr(reg, msr);
}
void intel_model_2065x_finalize_smm(void)
{
/* Lock C-State MSR */
msr_set_bit(MSR_PMG_CST_CONFIG_CONTROL, 15);
/* Lock AES-NI only if supported */
if (cpuid_ecx(1) & (1 << 25))
msr_set_bit(MSR_FEATURE_CONFIG, 0);
/* Lock TM interupts - route thermal events to all processors */
msr_set_bit(MSR_MISC_PWR_MGMT, 22);
/* Lock memory configuration to protect SMM */
msr_set_bit(MSR_LT_LOCK_MEMORY, 0);
}
|
/* This testcase is part of GDB, the GNU debugger.
Copyright 2015-2020 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 <http://www.gnu.org/licenses/>. */
#include <stdlib.h>
typedef int (*final_t) (int arg);
int
final (int arg)
{
return arg + 1;
}
asm (".type gnu_ifunc, %gnu_indirect_function");
final_t
gnu_ifunc (void)
{
return final;
}
extern int gnu_ifunc_alias (int arg) __attribute__ ((alias ("gnu_ifunc")));
static int resultvar;
int
main (void)
{
if (gnu_ifunc_alias (10) != 11)
abort ();
return resultvar;
}
|
/* GTK+ - accessibility implementations
* Copyright 2001 Sun Microsystems Inc.
*
* 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. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_CELL_ACCESSIBLE_PARENT_H__
#define __GTK_CELL_ACCESSIBLE_PARENT_H__
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk-a11y.h> can be included directly."
#endif
#include <atk/atk.h>
#include <gtk/a11y/gtkcellaccessible.h>
G_BEGIN_DECLS
/*
* The GtkCellAccessibleParent interface should be supported by any object
* which contains children which are flyweights, i.e. do not have corresponding
* widgets and the children need help from their parent to provide
* functionality. One example is GtkTreeViewAccessible where the children
* GtkCellAccessible need help from the GtkTreeViewAccessible in order to
* implement atk_component_get_extents().
*/
#define GTK_TYPE_CELL_ACCESSIBLE_PARENT (gtk_cell_accessible_parent_get_type ())
#define GTK_IS_CELL_ACCESSIBLE_PARENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_ACCESSIBLE_PARENT)
#define GTK_CELL_ACCESSIBLE_PARENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_ACCESSIBLE_PARENT, GtkCellAccessibleParent)
#define GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_CELL_ACCESSIBLE_PARENT, GtkCellAccessibleParentIface))
typedef struct _GtkCellAccessibleParent GtkCellAccessibleParent;
typedef struct _GtkCellAccessibleParentIface GtkCellAccessibleParentIface;
struct _GtkCellAccessibleParentIface
{
GTypeInterface parent;
void ( *get_cell_extents) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coord_type);
void ( *get_cell_area) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
GdkRectangle *cell_rect);
gboolean ( *grab_focus) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
int ( *get_child_index) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
GtkCellRendererState
( *get_renderer_state) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
/* actions */
void ( *expand_collapse) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
void ( *activate) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
void ( *edit) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
};
GDK_AVAILABLE_IN_ALL
GType gtk_cell_accessible_parent_get_type (void);
GDK_AVAILABLE_IN_ALL
void gtk_cell_accessible_parent_get_cell_extents (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coord_type);
GDK_AVAILABLE_IN_ALL
void gtk_cell_accessible_parent_get_cell_area (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
GdkRectangle *cell_rect);
GDK_AVAILABLE_IN_ALL
gboolean gtk_cell_accessible_parent_grab_focus (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
GDK_AVAILABLE_IN_ALL
int gtk_cell_accessible_parent_get_child_index (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
GDK_AVAILABLE_IN_ALL
GtkCellRendererState
gtk_cell_accessible_parent_get_renderer_state(GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
GDK_AVAILABLE_IN_ALL
void gtk_cell_accessible_parent_expand_collapse (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
GDK_AVAILABLE_IN_ALL
void gtk_cell_accessible_parent_activate (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
GDK_AVAILABLE_IN_ALL
void gtk_cell_accessible_parent_edit (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
G_END_DECLS
#endif /* __GTK_CELL_ACCESSIBLE_PARENT_H__ */
|
/* vi: set sw=4 ts=4: */
/*
* Mini fsync implementation for busybox
*
* Copyright (C) 2008 Nokia Corporation. All rights reserved.
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
//config:config FSYNC
//config: bool "fsync (3.7 kb)"
//config: default y
//config: help
//config: fsync is used to flush file-related cached blocks to disk.
//applet:IF_FSYNC(APPLET_NOFORK(fsync, fsync, BB_DIR_BIN, BB_SUID_DROP, fsync))
//kbuild:lib-$(CONFIG_FSYNC) += fsync.o
//usage:#define fsync_trivial_usage
//usage: "[-d] FILE..."
//usage:#define fsync_full_usage "\n\n"
//usage: "Write files' buffered blocks to disk\n"
//usage: "\n -d Avoid syncing metadata"
#include "libbb.h"
#ifndef O_NOATIME
# define O_NOATIME 0
#endif
/* This is a NOFORK applet. Be very careful! */
int fsync_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int fsync_main(int argc UNUSED_PARAM, char **argv)
{
int status;
int opts;
opts = getopt32(argv, "d"); /* fdatasync */
argv += optind;
if (!*argv) {
bb_show_usage();
}
status = EXIT_SUCCESS;
do {
int fd = open_or_warn(*argv, O_NOATIME | O_NOCTTY | O_RDONLY);
if (fd == -1) {
status = EXIT_FAILURE;
continue;
}
if ((opts ? fdatasync(fd) : fsync(fd))) {
//status = EXIT_FAILURE; - do we want this?
bb_simple_perror_msg(*argv);
}
close(fd);
} while (*++argv);
return status;
}
|
/*
* This file is part of the API Extractor project.
*
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
* Copyright (C) 2002-2005 Roberto Raggi <[email protected]>
*
* Contact: PySide team <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef SYMBOL_H
#define SYMBOL_H
#include <QtCore/QString>
#include <cstring>
#include <QtCore/QHash>
#include <QtCore/QPair>
struct NameSymbol
{
const char *data;
std::size_t count;
inline QString as_string() const
{
return QString::fromUtf8(data, (int) count);
}
inline bool operator == (const NameSymbol &other) const
{
return count == other.count
&& !std::strncmp(data, other.data, count);
}
protected:
inline NameSymbol() {}
inline NameSymbol(const char *d, std::size_t c)
: data(d), count(c) {}
private:
void operator = (const NameSymbol &);
friend class NameTable;
};
inline uint qHash(const NameSymbol &r)
{
uint hash_value = 0;
for (std::size_t i = 0; i < r.count; ++i)
hash_value = (hash_value << 5) - hash_value + r.data[i];
return hash_value;
}
inline uint qHash(const QPair<const char*, std::size_t> &r)
{
uint hash_value = 0;
for (std::size_t i = 0; i < r.second; ++i)
hash_value = (hash_value << 5) - hash_value + r.first[i];
return hash_value;
}
class NameTable
{
public:
typedef QPair<const char *, std::size_t> KeyType;
typedef QHash<KeyType, NameSymbol*> ContainerType;
public:
NameTable() {}
~NameTable()
{
qDeleteAll(_M_storage);
}
inline const NameSymbol *findOrInsert(const char *str, std::size_t len)
{
KeyType key(str, len);
NameSymbol *name = _M_storage.value(key);
if (!name) {
name = new NameSymbol(str, len);
_M_storage.insert(key, name);
}
return name;
}
inline std::size_t count() const { return _M_storage.size(); }
private:
ContainerType _M_storage;
private:
NameTable(const NameTable &other);
void operator=(const NameTable &other);
};
#endif // SYMBOL_H
// kate: space-indent on; indent-width 2; replace-tabs on;
|
/*
pmacct (Promiscuous mode IP Accounting package)
pmacct is Copyright (C) 2003-2014 by Paolo Lucente
*/
/*
Originally based on Quagga BGP routing table which is:
Copyright (C) 1998, 2001 Kunihiro Ishiguro
GNU Zebra is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
GNU Zebra 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 GNU Zebra; see the file COPYING. If not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#ifndef _BGP_TABLE_H_
#define _BGP_TABLE_H_
#define DEFAULT_BGP_INFO_HASH 13
#define DEFAULT_BGP_INFO_PER_PEER_HASH 1
/* AFI and SAFI type. */
typedef u_int16_t afi_t;
typedef u_int8_t safi_t;
typedef enum
{
BGP_TABLE_MAIN,
BGP_TABLE_RSCLIENT,
} bgp_table_t;
struct bgp_table
{
bgp_table_t type;
/* afi/safi of this table */
afi_t afi;
safi_t safi;
/* The owner of this 'bgp_table' structure. */
void *owner;
struct bgp_node *top;
unsigned long count;
};
struct bgp_node
{
struct prefix p;
struct bgp_table *table;
struct bgp_node *parent;
struct bgp_node *link[2];
#define l_left link[0]
#define l_right link[1]
void **info;
unsigned int lock;
/*
struct bgp_adj_out *adj_out;
struct bgp_adj_in *adj_in;
struct bgp_node *prn;
unsigned int lock;
u_char flags;
#define BGP_NODE_PROCESS_SCHEDULED (1 << 0)
*/
};
struct bgp_info_extra
{
rd_t rd;
u_char label[3];
path_id_t path_id;
};
struct bgp_info
{
struct bgp_info *next;
struct bgp_info *prev;
struct bgp_peer *peer;
struct bgp_attr *attr;
struct bgp_info_extra *extra;
};
/* Prototypes */
#if (!defined __BGP_TABLE_C)
#define EXT extern
#else
#define EXT
#endif
EXT struct bgp_table *bgp_table_init (afi_t, safi_t);
EXT void bgp_table_finish (struct bgp_table **);
EXT void bgp_unlock_node (struct bgp_node *node);
EXT struct bgp_node *bgp_table_top (const struct bgp_table *const);
EXT struct bgp_node *bgp_route_next (struct bgp_node *);
EXT struct bgp_node *bgp_route_next_until (struct bgp_node *, struct bgp_node *);
EXT struct bgp_node *bgp_node_get (struct bgp_table *const, struct prefix *);
EXT struct bgp_node *bgp_lock_node (struct bgp_node *node);
EXT struct bgp_node *bgp_node_match (const struct bgp_table *, struct prefix *, struct bgp_peer *);
EXT struct bgp_node *bgp_node_match_ipv4 (const struct bgp_table *, struct in_addr *, struct bgp_peer *);
#ifdef ENABLE_IPV6
EXT struct bgp_node *bgp_node_match_ipv6 (const struct bgp_table *, struct in6_addr *, struct bgp_peer *);
#endif /* ENABLE_IPV6 */
EXT unsigned long bgp_table_count (const struct bgp_table *const);
#undef EXT
#endif
|
/******************************************************************************
* Wormux is a convivial mass murder game.
* Copyright (C) 2001-2010 Wormux Team.
*
* 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
******************************************************************************
* Base classes for weapons configuration.
*****************************************************************************/
#ifndef WEAPON_CONFIGURATION_H
#define WEAPON_CONFIGURATION_H
//-----------------------------------------------------------------------------
#include "include/base.h"
typedef struct _xmlNode xmlNode;
//-----------------------------------------------------------------------------
class EmptyWeaponConfig
{
public:
virtual ~EmptyWeaponConfig() {};
virtual void LoadXml(const xmlNode* elem) = 0;
};
//-----------------------------------------------------------------------------
class WeaponConfig : public EmptyWeaponConfig
{
public:
uint damage;
public:
WeaponConfig();
virtual ~WeaponConfig() {};
virtual void LoadXml(const xmlNode* elem);
};
//-----------------------------------------------------------------------------
class ExplosiveWeaponConfig : public WeaponConfig
{
public:
uint timeout;
bool allow_change_timeout;
uint blast_range ;
uint blast_force ;
uint explosion_range;
uint particle_range;
uint speed_on_hit;
public:
ExplosiveWeaponConfig();
virtual ~ExplosiveWeaponConfig() {};
virtual void LoadXml(const xmlNode* elem);
};
//-----------------------------------------------------------------------------
#endif
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
*
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in
* advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*/
#include "ares_setup.h"
#if !defined(WIN32) || defined(WATT32)
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ares.h"
#include "ares_dns.h"
#include "inet_ntop.h"
#include "inet_net_pton.h"
#include "ares_getopt.h"
#include "ares_ipv6.h"
#ifndef HAVE_STRDUP
# include "ares_strdup.h"
# define strdup(ptr) ares_strdup(ptr)
#endif
#ifndef HAVE_STRCASECMP
# include "ares_strcasecmp.h"
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
#endif
#ifndef HAVE_STRNCASECMP
# include "ares_strcasecmp.h"
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
#endif
static void callback(void *arg, int status, int timeouts, struct hostent *host);
static void usage(void);
int main(int argc, char **argv)
{
ares_channel channel;
int status, nfds, c, addr_family = AF_INET;
fd_set read_fds, write_fds;
struct timeval *tvp, tv;
struct in_addr addr4;
struct ares_in6_addr addr6;
#ifdef USE_WINSOCK
WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
WSADATA wsaData;
WSAStartup(wVersionRequested, &wsaData);
#endif
status = ares_library_init(ARES_LIB_INIT_ALL);
if (status != ARES_SUCCESS)
{
fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
return 1;
}
while ((c = ares_getopt(argc,argv,"dt:h")) != -1)
{
switch (c)
{
case 'd':
#ifdef WATT32
dbug_init();
#endif
break;
case 't':
if (!strcasecmp(optarg,"a"))
addr_family = AF_INET;
else if (!strcasecmp(optarg,"aaaa"))
addr_family = AF_INET6;
else
usage();
break;
case 'h':
default:
usage();
break;
}
}
argc -= optind;
argv += optind;
if (argc < 1)
usage();
status = ares_init(&channel);
if (status != ARES_SUCCESS)
{
fprintf(stderr, "ares_init: %s\n", ares_strerror(status));
return 1;
}
/* Initiate the queries, one per command-line argument. */
for ( ; *argv; argv++)
{
if (ares_inet_pton(AF_INET, *argv, &addr4) == 1)
{
ares_gethostbyaddr(channel, &addr4, sizeof(addr4), AF_INET, callback,
*argv);
}
else if (ares_inet_pton(AF_INET6, *argv, &addr6) == 1)
{
ares_gethostbyaddr(channel, &addr6, sizeof(addr6), AF_INET6, callback,
*argv);
}
else
{
ares_gethostbyname(channel, *argv, addr_family, callback, *argv);
}
}
/* Wait for all queries to complete. */
for (;;)
{
FD_ZERO(&read_fds);
FD_ZERO(&write_fds);
nfds = ares_fds(channel, &read_fds, &write_fds);
if (nfds == 0)
break;
tvp = ares_timeout(channel, NULL, &tv);
select(nfds, &read_fds, &write_fds, NULL, tvp);
ares_process(channel, &read_fds, &write_fds);
}
ares_destroy(channel);
ares_library_cleanup();
#ifdef USE_WINSOCK
WSACleanup();
#endif
return 0;
}
static void callback(void *arg, int status, int timeouts, struct hostent *host)
{
char **p;
(void)timeouts;
if (status != ARES_SUCCESS)
{
fprintf(stderr, "%s: %s\n", (char *) arg, ares_strerror(status));
return;
}
for (p = host->h_addr_list; *p; p++)
{
char addr_buf[46] = "??";
ares_inet_ntop(host->h_addrtype, *p, addr_buf, sizeof(addr_buf));
printf("%-32s\t%s", host->h_name, addr_buf);
#if 0
if (host->h_aliases[0])
{
int i;
printf (", Aliases: ");
for (i = 0; host->h_aliases[i]; i++)
printf("%s ", host->h_aliases[i]);
}
#endif
puts("");
}
}
static void usage(void)
{
fprintf(stderr, "usage: ahost [-t {a|aaaa}] {host|addr} ...\n");
exit(1);
}
|
/* { dg-do run } */
/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-all -fno-unroll-loops --save-temps -fno-inline" } */
#define FTYPE double
#define OP >
#define INV_OP <=
#include "vect-fcm.x"
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
/* { dg-final { scan-assembler "fcmgt\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, v\[0-9\]+\.2d" } } */
/* { dg-final { scan-assembler "fcmgt\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, 0" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
/* { dg-final { cleanup-saved-temps } } */
|
/* Main interface for GDB, the GNU debugger.
Copyright (C) 2002-2020 Free Software Foundation, Inc.
This file is part of GDB.
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 MAIN_H
#define MAIN_H
struct captured_main_args
{
int argc;
char **argv;
const char *interpreter_p;
};
extern int gdb_main (struct captured_main_args *);
/* From main.c. */
extern int return_child_result;
extern int return_child_result_value;
extern int batch_silent;
extern int batch_flag;
/* * The name of the interpreter if specified on the command line. */
extern char *interpreter_p;
/* From mingw-hdep.c, used by main.c. */
/* Return argv[0] in absolute form, if possible, or ARGV0 if not. The
return value is in malloc'ed storage. */
extern char *windows_get_absolute_argv0 (const char *argv0);
/* Return read only pointer to the name of gdb as it was invoked. This
might have been expanded to an absolute path if required by the
platform. Could return NULL if called before gdb has had a chance to
parse the argv array. */
extern const char *get_gdb_program_name (void);
extern void set_gdb_data_directory (const char *new_data_dir);
#endif
|
/*
Copyright (C) 2008 Paul Davis
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 __ardour_onset_detector_h__
#define __ardour_onset_detector_h__
#include "ardour/audioanalyser.h"
namespace ARDOUR {
class AudioSource;
class Session;
class LIBARDOUR_API OnsetDetector : public AudioAnalyser
{
public:
OnsetDetector (float sample_rate);
~OnsetDetector();
static std::string operational_identifier();
void set_silence_threshold (float);
void set_peak_threshold (float);
void set_function (int);
int run (const std::string& path, Readable*, uint32_t channel, AnalysisFeatureList& results);
static void cleanup_onsets (AnalysisFeatureList&, float sr, float gap_msecs);
protected:
AnalysisFeatureList* current_results;
int use_features (Vamp::Plugin::FeatureSet&, std::ostream*);
static std::string _op_id;
};
} /* namespace */
#endif /* __ardour_audioanalyser_h__ */
|
/* -*- c++ -*- */
/*
* Copyright 2020 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef INCLUDED_NETWORK_TCP_SINK_IMPL_H
#define INCLUDED_NETWORK_TCP_SINK_IMPL_H
#include <gnuradio/network/tcp_sink.h>
#include <boost/asio.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/thread/thread.hpp>
namespace gr {
namespace network {
class NETWORK_API tcp_sink_impl : public tcp_sink
{
protected:
size_t d_itemsize;
size_t d_veclen;
std::string d_host;
int d_port;
int d_sinkmode;
bool d_thread_running;
bool d_stop_thread;
boost::thread* d_listener_thread;
bool d_start_new_listener;
bool d_initial_connection;
size_t d_block_size;
bool d_is_ipv6;
boost::system::error_code ec;
boost::asio::io_service d_io_service;
boost::asio::ip::tcp::endpoint d_endpoint;
boost::asio::ip::tcp::socket* d_tcpsocket = NULL;
boost::asio::ip::tcp::acceptor* d_acceptor = NULL;
bool d_connected;
virtual void connect(bool initial_connection);
virtual void run_listener();
public:
tcp_sink_impl(size_t itemsize,
size_t veclen,
const std::string& host,
int port,
int sinkmode = TCPSINKMODE_CLIENT);
~tcp_sink_impl();
virtual bool stop();
void accept_handler(boost::asio::ip::tcp::socket* new_connection,
const boost::system::error_code& error);
int work(int noutput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items);
};
} // namespace network
} // namespace gr
#endif /* INCLUDED_NETWORK_TCP_SINK_IMPL_H */
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Designer 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$
**
****************************************************************************/
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of Qt Designer. This header
// file may change from version to version without notice, or even be removed.
//
// We mean it.
//
#ifndef ABSTRACTMETAOBJECT_H
#define ABSTRACTMETAOBJECT_H
#include <QtDesigner/sdk_global.h>
#include <QtCore/QVariant>
#include <QtCore/QFlags>
QT_BEGIN_NAMESPACE
class QDESIGNER_SDK_EXPORT QDesignerMetaEnumInterface
{
public:
QDesignerMetaEnumInterface();
virtual ~QDesignerMetaEnumInterface();
virtual bool isFlag() const = 0;
virtual QString key(int index) const = 0;
virtual int keyCount() const = 0;
virtual int keyToValue(const QString &key) const = 0;
virtual int keysToValue(const QString &keys) const = 0;
virtual QString name() const = 0;
virtual QString scope() const = 0;
virtual QString separator() const = 0;
virtual int value(int index) const = 0;
virtual QString valueToKey(int value) const = 0;
virtual QString valueToKeys(int value) const = 0;
};
class QDESIGNER_SDK_EXPORT QDesignerMetaPropertyInterface
{
public:
enum Kind { EnumKind, FlagKind, OtherKind };
enum AccessFlag { ReadAccess = 0x0001, WriteAccess = 0x0002, ResetAccess = 0x0004 };
enum Attribute { DesignableAttribute = 0x0001, ScriptableAttribute = 0x0002, StoredAttribute = 0x0004, UserAttribute = 0x0008};
Q_DECLARE_FLAGS(Attributes, Attribute)
Q_DECLARE_FLAGS(AccessFlags, AccessFlag)
QDesignerMetaPropertyInterface();
virtual ~QDesignerMetaPropertyInterface();
virtual const QDesignerMetaEnumInterface *enumerator() const = 0;
virtual Kind kind() const = 0;
virtual AccessFlags accessFlags() const = 0;
virtual Attributes attributes(const QObject *object = 0) const = 0;
virtual QVariant::Type type() const = 0;
virtual QString name() const = 0;
virtual QString typeName() const = 0;
virtual int userType() const = 0;
virtual bool hasSetter() const = 0;
virtual QVariant read(const QObject *object) const = 0;
virtual bool reset(QObject *object) const = 0;
virtual bool write(QObject *object, const QVariant &value) const = 0;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QDesignerMetaPropertyInterface::AccessFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(QDesignerMetaPropertyInterface::Attributes)
class QDESIGNER_SDK_EXPORT QDesignerMetaMethodInterface
{
public:
QDesignerMetaMethodInterface();
virtual ~QDesignerMetaMethodInterface();
enum MethodType { Method, Signal, Slot, Constructor };
enum Access { Private, Protected, Public };
virtual Access access() const = 0;
virtual MethodType methodType() const = 0;
virtual QStringList parameterNames() const = 0;
virtual QStringList parameterTypes() const = 0;
virtual QString signature() const = 0;
virtual QString normalizedSignature() const = 0;
virtual QString tag() const = 0;
virtual QString typeName() const = 0;
};
class QDESIGNER_SDK_EXPORT QDesignerMetaObjectInterface {
public:
QDesignerMetaObjectInterface();
virtual ~QDesignerMetaObjectInterface();
virtual QString className() const = 0;
virtual const QDesignerMetaEnumInterface *enumerator(int index) const = 0;
virtual int enumeratorCount() const = 0;
virtual int enumeratorOffset() const = 0;
virtual int indexOfEnumerator(const QString &name) const = 0;
virtual int indexOfMethod(const QString &method) const = 0;
virtual int indexOfProperty(const QString &name) const = 0;
virtual int indexOfSignal(const QString &signal) const = 0;
virtual int indexOfSlot(const QString &slot) const = 0;
virtual const QDesignerMetaMethodInterface *method(int index) const = 0;
virtual int methodCount() const = 0;
virtual int methodOffset() const = 0;
virtual const QDesignerMetaPropertyInterface *property(int index) const = 0;
virtual int propertyCount() const = 0;
virtual int propertyOffset() const = 0;
virtual const QDesignerMetaObjectInterface *superClass() const = 0;
virtual const QDesignerMetaPropertyInterface *userProperty() const = 0;
};
// To be obtained from core
class QDESIGNER_SDK_EXPORT QDesignerIntrospectionInterface {
public:
QDesignerIntrospectionInterface();
virtual ~QDesignerIntrospectionInterface();
virtual const QDesignerMetaObjectInterface* metaObject(const QObject *object) const = 0;
};
QT_END_NAMESPACE
#endif // ABSTRACTMETAOBJECT_H
|
// This may look like C code, but it is really -*- C++ -*-
//
// Copyright Bob Friesenhahn, 2001, 2002
//
// CoderInfo Definition
//
// Container for image format support information.
//
#if !defined (Magick_CoderInfo_header)
#define Magick_CoderInfo_header 1
#include "Magick++/Include.h"
#include <string>
namespace Magick
{
class MagickDLLDecl CoderInfo
{
public:
enum MatchType {
AnyMatch, // match any coder
TrueMatch, // match coder if true
FalseMatch // match coder if false
};
// Default constructor
CoderInfo ( void );
// Copy constructor
CoderInfo ( const CoderInfo &coder_ );
// Construct with coder name
CoderInfo ( const std::string &name_ );
// Destructor
~CoderInfo ( void );
// Format name
std::string name( void ) const;
// Format description
std::string description( void ) const;
// Format is readable
bool isReadable( void ) const;
// Format is writeable
bool isWritable( void ) const;
// Format supports multiple frames
bool isMultiFrame( void ) const;
// Assignment operator
CoderInfo& operator= (const CoderInfo &coder_ );
//
// Implemementation methods
//
CoderInfo ( const MagickCore::MagickInfo *magickInfo_ );
private:
std::string _name;
std::string _description;
bool _isReadable;
bool _isWritable;
bool _isMultiFrame;
};
} // namespace Magick
//
// Inlines
//
#endif // Magick_CoderInfo_header
|
#ifndef PGEPACKETGLOABLS_H
#define PGEPACKETGLOABLS_H
///
/// \brief The PGEPacketsV2 enum
///
enum class PacketID{
PGENET_UNDEFINED = 0,
PGENET_CURSOR = 1
};
#endif // PGEPACKETGLOABLS_H
|
/*
* This file is part of the libsigrok project.
*
* Copyright (C) 2013 Bert Vermeulen <[email protected]>
*
* 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 LIBSIGROK_HARDWARE_UNI_T_UT32X_PROTOCOL_H
#define LIBSIGROK_HARDWARE_UNI_T_UT32X_PROTOCOL_H
#include <stdint.h>
#include <glib.h>
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
#define LOG_PREFIX "uni-t-ut32x"
#define DEFAULT_DATA_SOURCE DATA_SOURCE_LIVE
#define USB_CONN "1a86.e008"
#define VENDOR "UNI-T"
#define MODEL "UT32x"
#define USB_INTERFACE 0
#define USB_CONFIGURATION 1
#define EP_IN (0x80 | 2)
#define EP_OUT 2
enum {
DATA_SOURCE_LIVE,
DATA_SOURCE_MEMORY,
};
enum {
CMD_GET_LIVE = 1,
CMD_STOP = 2,
CMD_GET_STORED = 7,
};
/** Private, per-device-instance driver context. */
struct dev_context {
/* Acquisition settings */
uint64_t limit_samples;
gboolean data_source;
/* Operational state */
uint64_t num_samples;
unsigned char buf[8];
struct libusb_transfer *xfer;
/* Temporary state across callbacks */
unsigned char packet[32];
int packet_len;
};
SR_PRIV int uni_t_ut32x_handle_events(int fd, int revents, void *cb_data);
SR_PRIV void LIBUSB_CALL uni_t_ut32x_receive_transfer(struct libusb_transfer *transfer);
#endif
|
#ifndef R_PKCS7_H
#define R_PKCS7_H
typedef struct r_pkcs7_certificaterevocationlists_t {
ut32 length;
RX509CertificateRevocationList **elements;
} RPKCS7CertificateRevocationLists;
typedef struct r_pkcs7_extendedcertificatesandcertificates_t {
ut32 length;
RX509Certificate **elements;
} RPKCS7ExtendedCertificatesAndCertificates;
typedef struct r_pkcs7_digestalgorithmidentifiers_t {
ut32 length;
RX509AlgorithmIdentifier **elements;
} RPKCS7DigestAlgorithmIdentifiers;
typedef struct r_pkcs7_contentinfo_t {
RASN1String *contentType; //OID
RASN1Object *content; // optional. oid structure definition
} RPKCS7ContentInfo;
typedef struct r_pkcs7_issuerandserialnumber_t {
RX509Name issuer;
RASN1Object *serialNumber;
} RPKCS7IssuerAndSerialNumber;
typedef struct r_pkcs7_attribute_t {
RASN1String *oid; //OID
RASN1Object *data; // optional. oid structure definition
} RPKCS7Attribute;
typedef struct r_pkcs7_attributes_t {
ut32 length;
RPKCS7Attribute **elements;
} RPKCS7Attributes;
typedef struct r_pkcs7_signerinfo_t {
ut32 version;
RPKCS7IssuerAndSerialNumber issuerAndSerialNumber;
RX509AlgorithmIdentifier digestAlgorithm;
RPKCS7Attributes authenticatedAttributes; //Optional
RX509AlgorithmIdentifier digestEncryptionAlgorithm;
RASN1Object *encryptedDigest;
RPKCS7Attributes unauthenticatedAttributes; //Optional
} RPKCS7SignerInfo;
typedef struct r_pkcs7_signerinfos_t {
ut32 length;
RPKCS7SignerInfo **elements;
} RPKCS7SignerInfos;
typedef struct r_pkcs7_signeddata_t {
ut32 version;
RPKCS7DigestAlgorithmIdentifiers digestAlgorithms;
RPKCS7ContentInfo contentInfo;
RPKCS7ExtendedCertificatesAndCertificates certificates; //Optional
RPKCS7CertificateRevocationLists crls; //Optional
RPKCS7SignerInfos signerinfos;
} RPKCS7SignedData;
typedef struct r_pkcs7_container_t {
RASN1String *contentType;
RPKCS7SignedData signedData;
} RCMS;
R_API RCMS *r_pkcs7_parse_cms(const ut8 *buffer, ut32 length);
R_API void r_pkcs7_free_cms(RCMS* container);
R_API char* r_pkcs7_cms_dump(RCMS* container);
#endif /* R_PKCS7_H */
|
#include "c.h"
#define I(f) null_##f
static Node I(gen)(Node p) { return p; }
static void I(address)(Symbol q, Symbol p, long n) {}
static void I(blockbeg)(Env *e) {}
static void I(blockend)(Env *e) {}
static void I(defaddress)(Symbol p) {}
static void I(defconst)(int suffix, int size, Value v) {}
static void I(defstring)(int len, char *s) {}
static void I(defsymbol)(Symbol p) {}
static void I(emit)(Node p) {}
static void I(export)(Symbol p) {}
static void I(function)(Symbol f, Symbol caller[], Symbol callee[], int ncalls) {}
static void I(global)(Symbol p) {}
static void I(import)(Symbol p) {}
static void I(local)(Symbol p) {}
static void I(progbeg)(int argc, char *argv[]) {}
static void I(progend)(void) {}
static void I(segment)(int s) {}
static void I(space)(int n) {}
static void I(stabblock)(int brace, int lev, Symbol *p) {}
static void I(stabend)(Coordinate *cp, Symbol p, Coordinate **cpp, Symbol *sp, Symbol *stab) {}
static void I(stabfend)(Symbol p, int lineno) {}
static void I(stabinit)(char *file, int argc, char *argv[]) {}
static void I(stabline)(Coordinate *cp) {}
static void I(stabsym)(Symbol p) {}
static void I(stabtype)(Symbol p) {}
static char rcsid[] = "$Id$";
Interface nullIR = {
1, 1, 0, /* char */
2, 2, 0, /* short */
4, 4, 0, /* int */
8, 8, 1, /* long */
8 ,8, 1, /* long long */
4, 4, 1, /* float */
8, 8, 1, /* double */
16,16,1, /* long double */
4, 4, 0, /* T* */
0, 4, 0, /* struct */
1, /* little_endian */
0, /* mulops_calls */
0, /* wants_callb */
0, /* wants_argb */
1, /* left_to_right */
0, /* wants_dag */
0, /* unsigned_char */
I(address),
I(blockbeg),
I(blockend),
I(defaddress),
I(defconst),
I(defstring),
I(defsymbol),
I(emit),
I(export),
I(function),
I(gen),
I(global),
I(import),
I(local),
I(progbeg),
I(progend),
I(segment),
I(space),
I(stabblock),
I(stabend),
I(stabfend),
I(stabinit),
I(stabline),
I(stabsym),
I(stabtype)
};
|
/*
* Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
*
* Author: Tuomo Penttinen <[email protected]>
*
* This file is part of Herqq UPnP Av (HUPnPAv) library.
*
* Herqq UPnP Av 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.
*
* Herqq UPnP Av 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 Herqq UPnP Av. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef HMEDIASERVER_DEVICECONFIGURATION_P_H_
#define HMEDIASERVER_DEVICECONFIGURATION_P_H_
//
// !! Warning !!
//
// This file is not part of public API and it should
// never be included in client code. The contents of this file may
// change or the file may be removed without of notice.
//
#include <HUpnpAv/HUpnpAv>
#include <QtCore/QScopedPointer>
namespace Herqq
{
namespace Upnp
{
namespace Av
{
//
//
//
class H_UPNP_AV_EXPORT HMediaServerDeviceConfigurationPrivate
{
H_DISABLE_COPY(HMediaServerDeviceConfigurationPrivate)
public:
QScopedPointer<HContentDirectoryServiceConfiguration> m_cdsConf;
QScopedPointer<HConnectionManagerServiceConfiguration> m_cmConf;
HMediaServerDeviceConfigurationPrivate();
virtual ~HMediaServerDeviceConfigurationPrivate();
};
}
}
}
#endif /* HMEDIASERVER_DEVICECONFIGURATION_P_H_ */
|
/****************************************************************************
**
** Copyright (C) 2016 Jochen Becher
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** 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.
**
****************************************************************************/
#pragma once
namespace qmt {
// mime types for drag&drop
static const char MIME_TYPE_MODEL_ELEMENTS[] = "text/model-elements";
static const char MIME_TYPE_NEW_MODEL_ELEMENTS[] = "text/new-model-elements";
// object type constants used within drag&drop
static const char ELEMENT_TYPE_PACKAGE[] = "package";
static const char ELEMENT_TYPE_COMPONENT[] = "component";
static const char ELEMENT_TYPE_CLASS[] = "class";
static const char ELEMENT_TYPE_ITEM[] = "item";
static const char ELEMENT_TYPE_ANNOTATION[] = "annotation";
static const char ELEMENT_TYPE_BOUNDARY[] = "boundary";
static const char ELEMENT_TYPE_SWIMLANE[] = "swimlane";
} // namespace qmt
|
/****************************************************************
* *
* Copyright 2001, 2013 Fidelity Information Services, Inc *
* *
* This source code contains the intellectual property *
* of its copyright holder(s), and is made available *
* under a license. If you do not know the terms of *
* the license, please stop and do not read further. *
* *
****************************************************************/
typedef struct joberr_msg_struct{
char *msg;
int len;
}joberr_msg;
/*
* The follwoing array is index by values from the enum joberr_t from jobsp.h.
*/
LITDEF joberr_msg joberrs[] = {
"", 0,
LIT_AND_LEN("Job error in child process"),
LIT_AND_LEN("Job error in opening STDIN"),
LIT_AND_LEN("Job error in directing input to STDIN"),
LIT_AND_LEN("Job error in creating STDOUT"),
LIT_AND_LEN("Job error in opening STDOUT"),
LIT_AND_LEN("Job error in directing output to STDOUT"),
LIT_AND_LEN("Job error in creating STDERR"),
LIT_AND_LEN("Job error in opening STDERR"),
LIT_AND_LEN("Job error in directing output to STDERR"),
LIT_AND_LEN("Job error in directory specification"),
LIT_AND_LEN("Job error - CHDIR error"),
LIT_AND_LEN("Job error in routine specification. Label and offset not found in created process"),
LIT_AND_LEN("Job error in setting independent session"),
LIT_AND_LEN("Job error in fork"),
LIT_AND_LEN("Job error in renaming standard output file"),
LIT_AND_LEN("Job error in renaming standard error file"),
LIT_AND_LEN("Job error in middle process to parent process pipe communication"),
LIT_AND_LEN("Job error in middle process to grandchild process pipe communication"),
LIT_AND_LEN("Job child was stopped by signal"),
LIT_AND_LEN("Job child terminated due to signal"),
LIT_AND_LEN("") /* this is used internally to determine try-again situations */
};
|
/*
IPOL SIFT
Copyright (C) 2014, Ives Rey-Otero, CMLA ENS Cachan
<[email protected]>
Version 20140911 (September 11th, 2014)
This C ANSI source code is related to the IPOL publication
[1] "Anatomy of the SIFT Method."
I. Rey Otero and M. Delbracio
Image Processing Online, 2013.
http://www.ipol.im/pub/algo/rd_anatomy_sift/
An IPOL demo is available at
http://www.ipol.im/pub/demo/rd_anatomy_sift/
== Patent Warning and License =================================================
The SIFT method is patented
[3] "Method and apparatus for identifying scale invariant features
in an image."
David G. Lowe
Patent number: 6711293
Filing date: Mar 6, 2000
Issue date: Mar 23, 2004
Application number: 09/519,89
These source codes are made available for the exclusive aim of serving as
scientific tool to verify the soundness and completeness of the algorithm
description. Compilation, execution and redistribution of this file may
violate patents rights in certain countries. The situation being different
for every country and changing over time, it is your responsibility to
determine which patent rights restrictions apply to you before you compile,
use, modify, or redistribute this file. A patent lawyer is qualified to make
this determination. If and only if they don't conflict with any patent terms,
you can benefit from the following license terms attached to this file.
This program is free software: you can use, modify and/or
redistribute it under the terms of the simplified BSD
License. You should have received a copy of this license along
this program. If not, see
<http://www.opensource.org/licenses/bsd-license.html>.
*/
/**
* @file sift_description.c
* @brief Computation the SIFT feature vector
*
* @li Attribution of a principal orientation
* @li Computation of the SIFT feature vector
*
* @author Ives Rey-Otero <[email protected]>
*/
#ifndef _LIB_DESCRIPTION_H_
#define _LIB_DESCRIPTION_H_
void sift_accumulate_orientation_histogram(float x_key,
float y_key,
float sigma_key,
const float* gradX,
const float* gradY,
int w,
int h,
int nbins,
float lambda_ori,
float* hist);
// Apply smoothing and extract local extrema
int sift_extract_principal_orientations(float* hist,
int nbins,
float threshold,
float* principal_orientations);
// Apply smoothing and extract the global extremum
float sift_extract_one_orientation(float* hist, int nbins);
// Accumulate the descriptor's histograms
void sift_extract_feature_vector(float x_key,
float y_key,
float sigma_key,
float theta_key,
const float* gradX,
const float* gradY,
int w,
int h,
int Nhist,
int Nbins,
float lambda_descr,
float* descr);
void sift_threshold_and_quantize_feature_vector(float* descr, int n, float threshold);
#endif // _LIB_DESCRIPTION_H_
|
//******************************************************************************
///
/// @file vfe/vfeprecomp.h
///
/// Precompiled header for the user interface portions of POV-Ray.
///
/// @copyright
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
/// Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
/// published by the Free Software Foundation, either version 3 of the
/// License, or (at your option) any later version.
///
/// POV-Ray is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Affero General Public License for more details.
///
/// You should have received a copy of the GNU Affero General Public License
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// ----------------------------------------------------------------------------
///
/// POV-Ray is based on the popular DKB raytracer version 2.12.
/// DKBTrace was originally written by David K. Buck.
/// DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
///
/// @endparblock
///
//******************************************************************************
/// @file
/// @note
/// @parblock
/// This header file is _not_ explicitly included in any source file (except @ref vfe/vfeprecomp.cpp
/// which is designed to allow for precompiling this header in the first place). To use
/// precompiled headers, you will therefore have to make your build environment automatically
/// inject this header at the start of every source file.
///
/// The rationale behind this is to keep the set of headers included in each source file at an
/// absolute minimum when precompiled headers are _not_ used.
/// @endparblock
#include "base/configbase.h" // only pulled in for POV_MULTITHREADED
// C++ variants of C standard header files
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
// C++ standard header files
#include <algorithm>
#include <chrono>
#include <list>
#include <map>
#include <memory>
#include <new>
#include <set>
#include <stack>
#include <stdexcept>
#include <string>
#include <vector>
// Boost header files
#include <boost/format.hpp>
|
#include <glib.h>
#ifndef BD_UTILS_SIZES
#define BD_UTILS_SIZES
#define KIBIBYTE *1024ULL
#define MEBIBYTE *1024ULL KIBIBYTE
#define GIBIBYTE *1024ULL MEBIBYTE
#define TEBIBYTE *1024ULL GIBIBYTE
#define PEBIBYTE *1024ULL TEBIBYTE
#define EXBIBYTE *1024ULL PEBIBYTE
#define KiB KIBIBYTE
#define MiB MEBIBYTE
#define GiB GIBIBYTE
#define TiB TEBIBYTE
#define PiB PEBIBYTE
#define EiB EXBIBYTE
#define BD_UTILS_SIZE_ERROR bd_utils_size_error_quark ()
typedef enum {
BD_UTILS_SIZE_ERROR_INVALID_SPEC,
} BDUtilsSizeError;
gchar* bd_utils_size_human_readable (guint64 size);
guint64 bd_utils_size_from_spec (gchar *spec, GError **error);
#endif /* BD_UTILS_SIZES */
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef ADDLIBRARYWIZARD_H
#define ADDLIBRARYWIZARD_H
#include <utils/wizard.h>
#include <utils/pathchooser.h>
QT_BEGIN_NAMESPACE
class QRadioButton;
class QCheckBox;
class QLabel;
QT_END_NAMESPACE
namespace QmakeProjectManager {
namespace Internal {
class LibraryDetailsWidget;
class LibraryDetailsController;
class LibraryTypePage;
class DetailsPage;
class SummaryPage;
namespace Ui { class LibraryDetailsWidget; }
class AddLibraryWizard : public Utils::Wizard
{
Q_OBJECT
public:
enum LibraryKind {
InternalLibrary,
ExternalLibrary,
SystemLibrary,
PackageLibrary
};
enum LinkageType {
DynamicLinkage,
StaticLinkage,
NoLinkage
};
enum MacLibraryType {
FrameworkType,
LibraryType,
NoLibraryType
};
enum Platform {
LinuxPlatform = 0x01,
MacPlatform = 0x02,
WindowsMinGWPlatform = 0x04,
WindowsMSVCPlatform = 0x08
};
Q_DECLARE_FLAGS(Platforms, Platform)
explicit AddLibraryWizard(const QString &fileName, QWidget *parent = 0);
~AddLibraryWizard();
LibraryKind libraryKind() const;
QString proFile() const;
QString snippet() const;
signals:
private:
LibraryTypePage *m_libraryTypePage;
DetailsPage *m_detailsPage;
SummaryPage *m_summaryPage;
QString m_proFile;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(AddLibraryWizard::Platforms)
class LibraryTypePage : public QWizardPage
{
Q_OBJECT
public:
LibraryTypePage(AddLibraryWizard *parent);
AddLibraryWizard::LibraryKind libraryKind() const;
private:
QRadioButton *m_internalRadio;
QRadioButton *m_externalRadio;
QRadioButton *m_systemRadio;
QRadioButton *m_packageRadio;
};
class DetailsPage : public QWizardPage
{
Q_OBJECT
public:
DetailsPage(AddLibraryWizard *parent);
virtual void initializePage();
virtual bool isComplete() const;
QString snippet() const;
private:
AddLibraryWizard *m_libraryWizard;
Ui::LibraryDetailsWidget *m_libraryDetailsWidget;
LibraryDetailsController *m_libraryDetailsController;
};
class SummaryPage : public QWizardPage
{
Q_OBJECT
public:
SummaryPage(AddLibraryWizard *parent);
virtual void initializePage();
QString snippet() const;
private:
AddLibraryWizard *m_libraryWizard;
QLabel *m_summaryLabel;
QLabel *m_snippetLabel;
QString m_snippet;
};
class LibraryPathChooser : public Utils::PathChooser
{
Q_OBJECT
public:
LibraryPathChooser(QWidget *parent);
virtual bool validatePath(const QString &path, QString *errorMessage);
};
} // namespace Internal
} // namespace QmakeProjectManager
#endif // ADDLIBRARYWIZARD_H
|
/*
Copyright (C) 2004 by Andrew Mann
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; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef SNDSYS_RENDERER_SOFTWARE_LISTENER_H
#define SNDSYS_RENDERER_SOFTWARE_LISTENER_H
#include "csgeom/transfrm.h"
#include "isndsys/ss_listener.h"
#include "csutil/scf_implementation.h"
class csListenerProperties
{
public:
csListenerProperties() {}
csListenerProperties(csListenerProperties *copy_from) { Copy(copy_from); }
~csListenerProperties() {}
void Copy(csListenerProperties *copy_from)
{
front.Set(copy_from->front);
top.Set(copy_from->top);
position.Set(copy_from->position);
distance_factor=copy_from->distance_factor;
rolloff_factor=copy_from->rolloff_factor;
// Setup the world-to-listener translation
world_to_listener.SetOrigin(position);
csVector3 rightvec;
rightvec.Cross(top, front);
world_to_listener.SetO2T(csMatrix3(rightvec.x, rightvec.y, rightvec.z,
top.x, top.y, top.z,
front.x, front.y, front.z));
}
public:
csVector3 front,top,position;
float distance_factor,rolloff_factor;
csTransform world_to_listener;
};
class SndSysListenerSoftware :
public scfImplementation1<SndSysListenerSoftware, iSndSysListener>
{
public:
SndSysListenerSoftware();
virtual ~SndSysListenerSoftware();
//------------------------
// iSndSysListener
//------------------------
public:
/// Set direction of listener (front and top 3d vectors)
virtual void SetDirection (const csVector3 &Front, const csVector3 &Top);
/// Set position of listener
virtual void SetPosition (const csVector3 &pos);
/// Set a distance attenuator
virtual void SetDistanceFactor (float factor);
/// Set a RollOff factor
virtual void SetRollOffFactor (float factor);
/// set type of environment where 'live' listener
//virtual void SetEnvironment (csSoundEnvironment env);
/// Get direction of listener (front and top 3d vectors)
virtual void GetDirection (csVector3 &Front, csVector3 &Top);
/// Get position of listener
virtual const csVector3 &GetPosition ();
/// Get a distance attenuator
virtual float GetDistanceFactor ();
/// Get a RollOff factor
virtual float GetRollOffFactor ();
/// Get type of environment where 'live' listener
//virtual csSoundEnvironment GetEnvironment ();
//----------------------------
// Non-Interface Functionality
//----------------------------
/// Migrate any queued changes to the active set
void UpdateQueuedProperties();
public:
csListenerProperties active_properties,queued_properties;
bool queued_update;
};
#endif // #ifndef SNDSYS_RENDERER_SOFTWARE_LISTENER_H
|
/*
* Copyright (C) 2009 Jan Michael Alonzo
*
* 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.
*/
#include <glib.h>
#include <gtk/gtk.h>
#include <webkit/webkit.h>
#if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0)
typedef struct {
WebKitWebHistoryItem* item;
} WebHistoryItemFixture;
static void web_history_item_fixture_setup(WebHistoryItemFixture* fixture,
gconstpointer data)
{
fixture->item = webkit_web_history_item_new_with_data("http://example.com/", "Example1");
g_assert_cmpint(G_OBJECT(fixture->item)->ref_count, == , 1);
g_assert(fixture->item != NULL);
}
static void web_history_item_fixture_teardown(WebHistoryItemFixture* fixture,
gconstpointer data)
{
g_assert(fixture->item != NULL);
g_assert_cmpint(G_OBJECT(fixture->item)->ref_count, ==, 1);
}
static void test_webkit_web_history_item_get_data(WebHistoryItemFixture* fixture,
gconstpointer data)
{
g_assert_cmpstr(webkit_web_history_item_get_title(fixture->item), ==, "Example1");
g_assert_cmpstr(webkit_web_history_item_get_uri(fixture->item), ==, "http://example.com/");
}
static void test_webkit_web_history_item_alternate_title(WebHistoryItemFixture* fixture,
gconstpointer data)
{
webkit_web_history_item_set_alternate_title(fixture->item, "Alternate title");
g_assert_cmpstr(webkit_web_history_item_get_alternate_title(fixture->item), ==, "Alternate title");
}
int main(int argc, char** argv)
{
g_thread_init(NULL);
gtk_test_init(&argc, &argv, NULL);
g_test_bug_base("https://bugs.webkit.org/");
g_test_add("/webkit/webhistoryitem/get_data",
WebHistoryItemFixture, 0, web_history_item_fixture_setup,
test_webkit_web_history_item_get_data, web_history_item_fixture_teardown);
g_test_add("/webkit/webhistoryitem/alternate_title",
WebHistoryItemFixture, 0, web_history_item_fixture_setup,
test_webkit_web_history_item_alternate_title, web_history_item_fixture_teardown);
return g_test_run ();
}
#else
int main(int argc, char** argv)
{
g_critical("You will need at least glib-2.16.0 and gtk-2.14.0 to run the unit tests. Doing nothing now.");
return 0;
}
#endif
|
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXDE-Qt - a lightweight, Qt based, desktop toolset
* http://razor-qt.org
*
* Copyright: 2010-2011 Razor team
* Authors:
* Alexander Sokoloff <[email protected]>
*
* This program or library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* END_COMMON_COPYRIGHT_HEADER */
#ifndef TRAYICON_H
#define TRAYICON_H
#include <QObject>
#include <QFrame>
#include <QList>
#include <X11/X.h>
#include <X11/extensions/Xdamage.h>
#define TRAY_ICON_SIZE_DEFAULT 24
class QWidget;
class LxQtPanel;
class TrayIcon: public QFrame
{
Q_OBJECT
Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
public:
TrayIcon(Window iconId, QWidget* parent);
virtual ~TrayIcon();
Window iconId() { return mIconId; }
Window windowId() { return mWindowId; }
bool isValid() const { return mValid; }
QSize iconSize() const { return mIconSize; }
void setIconSize(QSize iconSize);
QSize sizeHint() const;
protected:
bool event(QEvent *event);
void draw(QPaintEvent* event);
private:
bool init();
QRect iconGeometry();
Window mIconId;
Window mWindowId;
bool mValid;
QSize mIconSize;
Damage mDamage;
Display* mDisplay;
static bool isXCompositeAvailable();
};
#endif // TRAYICON_H
|
// Copyright (c) 2012-2013 Andre Martins
// All Rights Reserved.
//
// This file is part of TurboParser 2.1.
//
// TurboParser 2.1 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 3 of the License, or
// (at your option) any later version.
//
// TurboParser 2.1 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 TurboParser 2.1. If not, see <http://www.gnu.org/licenses/>.
#ifndef SEQUENCEDECODER_H_
#define SEQUENCEDECODER_H_
#include "Decoder.h"
class SequencePipe;
class SequenceDecoder : public Decoder {
public:
SequenceDecoder() {};
SequenceDecoder(SequencePipe *pipe) : pipe_(pipe) {};
virtual ~SequenceDecoder() {};
void Decode(Instance *instance, Parts *parts,
const vector<double> &scores,
vector<double> *predicted_output);
void DecodeCostAugmented(Instance *instance, Parts *parts,
const vector<double> &scores,
const vector<double> &gold_output,
vector<double> *predicted_output,
double *cost,
double *loss);
virtual void DecodeMarginals(Instance *instance, Parts *parts,
const vector<double> &scores,
const vector<double> &gold_output,
vector<double> *predicted_output,
double *entropy,
double *loss) {
// TODO: Implement forward-backward.
CHECK(false) << "Not implemented yet.";
}
void ConvertToFirstOrderModel(
const vector<vector<double> > &node_scores,
const vector<vector<vector<double> > > &edge_scores,
const vector<vector<vector<vector<double> > > > &triplet_scores,
vector<vector<double> > *transformed_node_scores,
vector<vector<vector<std::pair<int, double> > > > *transformed_edge_scores);
//vector<vector<vector<double> > > *transformed_edge_scores);
void RecoverBestPath(
const vector<int> &best_path,
const vector<vector<vector<double> > > &edge_scores,
vector<int> *transformed_best_path);
double RunViterbi(const vector<vector<double> > &node_scores,
const vector<vector<vector<double > > >
&edge_scores,
vector<int> *best_path);
double RunViterbi(const vector<vector<double> > &node_scores,
const vector<vector<vector<std::pair<int, double> > > >
&edge_scores,
vector<int> *best_path);
#ifdef USE_CPLEX
double DecodeCPLEX(Instance *instance, Parts *parts,
const vector<double> &scores,
bool relax,
vector<double> *predicted_output);
#endif
protected:
SequencePipe *pipe_;
};
#endif /* SEQUENCEDECODER_H_ */
|
#ifndef REGTEST
#include <threads.h>
#include <pthread.h>
#include <errno.h>
int mtx_trylock(mtx_t *mtx)
{
switch(pthread_mutex_trylock(mtx)) {
case 0:
return thrd_success;
case EBUSY:
return thrd_busy;
default:
return thrd_error;
}
}
#endif
#ifdef TEST
#include <_PDCLIB_test.h>
int main( void )
{
return TEST_RESULTS;
}
#endif
|
#ifndef NX_MOUSE_DRAG_H
#define NX_MOUSE_DRAG_H
#include "NxVec3.h"
#include "NxRay.h"
class NxPhysicsSDK;
class NxScene;
class NxShape;
class NxActor;
class NxSoftBody;
class NxCloth;
namespace SOFTBODY
{
class NxMouseDrag;
enum NxDragType
{
NGT_NONE = 0,
NGT_STATIC_SHAPE = (1<<0),
NGT_DYNAMIC_SHAPE = (1<<1),
NGT_CLOTH = (1<<2),
NGT_SOFTBODY = (1<<3),
NGT_ALL = (NGT_STATIC_SHAPE | NGT_DYNAMIC_SHAPE | NGT_CLOTH | NGT_SOFTBODY)
};
class NxDragInfo
{
public:
NxDragInfo(void)
{
mDragType = NGT_NONE;
mShape = 0;
mScene = 0;
mSelect.set(0,0,0);
mIntersect.set(0,0,0);
mRay.orig.set(0,0,0);
mRay.dir.set(0,0,0);
mDragPosition.set(0,0,0);
mVertexID = 0;
mLinearDamping = 0;
mAngularDamping = 0;
mSelectDistance = 0;
}
NxDragType mDragType;
union
{
NxShape *mShape; // shape on an actor that is being dragged.
NxCloth *mCloth; // cloth that is being dragged.
NxSoftBody *mSoftBody; // soft body that is being dragged.
};
NxScene *mScene; // the scene that the object is from.
NxVec3 mSelect; // the original selection location (in object space if a shape)
NxVec3 mIntersect; // the intersection location in worldspace
NxVec3 mDragPosition; // the position we last 'dragged' to.
NxRay mRay; // raycast in world space.
NxU32 mVertexID;
float mLinearDamping;
float mAngularDamping;
float mSelectDistance;
};
NxMouseDrag * createMouseDrag(NxPhysicsSDK *sdk, // sdk instance to do mouse dragging on
NxScene *scene, // if only dragging on a specific scene, null means all scenes
int screenWid, // width of the graphics screen
int screenHit); // height of the graphics screen
void releaseMouseDrag(NxMouseDrag *drag); // relase the mouse drag interface
NxDragInfo * mouseDrag(NxMouseDrag *drag, // the mouse drag interface
const float *view, // the view matrix
const float *projection, // the projection matrix
int screenX, // the screen x position of the mouse
int screenY, // the screen y position of the mouse
NxDragType types, // the types of objects it is ok to drag
float dtime); // delta time on last frame.
bool isMouseSelected(NxMouseDrag *drag); // true if something is currently being dragged.
void mouseDragDeselect(NxMouseDrag *drag); // indicate that a deselection event has occured.
void mouseDragWheel(NxMouseDrag *drag,int delta); // moves the selected object closer to or further away from the camera based on the sign of the mouse wheel value.
};
#endif
|
/*
* Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under both the BSD-style license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
*/
#ifndef ZSTD_COMPRESS_SEQUENCES_H
#define ZSTD_COMPRESS_SEQUENCES_H
#include "fse.h" /* FSE_repeat, FSE_CTable */
#include "zstd_internal.h" /* symbolEncodingType_e, ZSTD_strategy */
typedef enum {
ZSTD_defaultDisallowed = 0,
ZSTD_defaultAllowed = 1
} ZSTD_defaultPolicy_e;
symbolEncodingType_e
ZSTD_selectEncodingType(
FSE_repeat* repeatMode, unsigned const* count, unsigned const max,
size_t const mostFrequent, size_t nbSeq, unsigned const FSELog,
FSE_CTable const* prevCTable,
short const* defaultNorm, U32 defaultNormLog,
ZSTD_defaultPolicy_e const isDefaultAllowed,
ZSTD_strategy const strategy);
size_t
ZSTD_buildCTable(void* dst, size_t dstCapacity,
FSE_CTable* nextCTable, U32 FSELog, symbolEncodingType_e type,
unsigned* count, U32 max,
const BYTE* codeTable, size_t nbSeq,
const S16* defaultNorm, U32 defaultNormLog, U32 defaultMax,
const FSE_CTable* prevCTable, size_t prevCTableSize,
void* entropyWorkspace, size_t entropyWorkspaceSize);
size_t ZSTD_encodeSequences(
void* dst, size_t dstCapacity,
FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable,
FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable,
FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable,
seqDef const* sequences, size_t nbSeq, int longOffsets, int bmi2);
size_t ZSTD_fseBitCost(
FSE_CTable const* ctable,
unsigned const* count,
unsigned const max);
size_t ZSTD_crossEntropyCost(short const* norm, unsigned accuracyLog,
unsigned const* count, unsigned const max);
#endif /* ZSTD_COMPRESS_SEQUENCES_H */
|
/**********************************************************************
*
* geo_free.c -- Public routines for GEOTIFF GeoKey access.
*
* Written By: Niles D. Ritter.
*
* copyright (c) 1995 Niles D. Ritter
*
* Permission granted to use this software, so long as this copyright
* notice accompanies any products derived therefrom.
*
**********************************************************************/
#include "geotiff.h" /* public interface */
#include "geo_tiffp.h" /* external TIFF interface */
#include "geo_keyp.h" /* private interface */
/**********************************************************************
*
* Public Routines
*
**********************************************************************/
/**
This function deallocates an existing GeoTIFF access handle previously
created with GTIFNew(). If the handle was
used to write GeoTIFF keys to the TIFF file, the
GTIFWriteKeys() function should be used
to flush results to the file before calling GTIFFree(). GTIFFree()
should be called before XTIFFClose() is
called on the corresponding TIFF file handle.<p>
*/
void GTIFFree(GTIF* gtif)
{
int i;
if (!gtif) return;
/* Free parameter arrays */
if (gtif->gt_double) _GTIFFree (gtif->gt_double);
if (gtif->gt_short) _GTIFFree (gtif->gt_short);
/* Free GeoKey arrays */
if (gtif->gt_keys)
{
for (i = 0; i < MAX_KEYS; i++)
{
if (gtif->gt_keys[i].gk_type == TYPE_ASCII)
{
_GTIFFree (gtif->gt_keys[i].gk_data);
}
}
_GTIFFree (gtif->gt_keys);
}
if (gtif->gt_keyindex) _GTIFFree (gtif->gt_keyindex);
_GTIFFree (gtif);
}
|
/**
* @file
* Application layered TCP connection API (to be used from TCPIP thread)\n
* This interface mimics the tcp callback API to the application while preventing
* direct linking (much like virtual functions).
* This way, an application can make use of other application layer protocols
* on top of TCP without knowing the details (e.g. TLS, proxy connection).
*
* This file contains the base implementation calling into tcp.
*/
/*
* Copyright (c) 2017 Simon Goldschmidt
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Simon Goldschmidt <[email protected]>
*
*/
#ifndef LWIP_HDR_ALTCP_TCP_H
#define LWIP_HDR_ALTCP_TCP_H
#include "lwip/opt.h"
#if LWIP_ALTCP /* don't build if not configured for use in lwipopts.h */
#include "lwip/altcp.h"
#ifdef __cplusplus
extern "C" {
#endif
struct altcp_pcb *altcp_tcp_new_ip_type(u8_t ip_type);
#define altcp_tcp_new() altcp_tcp_new_ip_type(IPADDR_TYPE_V4)
#define altcp_tcp_new_ip6() altcp_tcp_new_ip_type(IPADDR_TYPE_V6)
struct altcp_pcb *altcp_tcp_alloc(void *arg, u8_t ip_type);
struct tcp_pcb;
struct altcp_pcb *altcp_tcp_wrap(struct tcp_pcb *tpcb);
#ifdef __cplusplus
}
#endif
#endif /* LWIP_ALTCP */
#endif /* LWIP_HDR_ALTCP_TCP_H */
|
/**
* Copyright (C) 2009 bdferris <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import "OBANavigationTarget.h"
@protocol OBANavigationTargetAware
- (OBANavigationTarget*) navigationTarget;
@optional
- (void) setNavigationTarget:(OBANavigationTarget*)navigationTarget;
@end
|
/*
* StopNgramStats.h --
* N-gram statistics with contexts excluding stop words
*
* Copyright (c) 1996,2002 SRI International. All Rights Reserved.
*
* @(#)$Header: /home/srilm/devel/lm/src/RCS/StopNgramStats.h,v 1.4 2003/11/14 18:20:27 stolcke Exp $
*
*/
#ifndef _StopNgramStats_h_
#define _StopNgramStats_h_
#include "NgramStats.h"
#include "SubVocab.h"
class StopNgramStats: public NgramStats
{
public:
StopNgramStats(Vocab &vocab, SubVocab &stopWords, unsigned maxOrder);
virtual unsigned countSentence(const VocabIndex *words)
{ return countSentence(words, (NgramCount)1); };
virtual unsigned countSentence(const VocabIndex *words, NgramCount factor);
SubVocab &stopWords; /* stop word set */
protected:
void incrementCounts(const VocabIndex *words, NgramCount factor);
};
#endif /* _StopNgramStats_h_ */
|
#ifndef _IPXE_IB_MCAST_H
#define _IPXE_IB_MCAST_H
/** @file
*
* Infiniband multicast groups
*
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/infiniband.h>
struct ib_mad_transaction;
/** An Infiniband multicast group membership */
struct ib_mc_membership {
/** Queue pair */
struct ib_queue_pair *qp;
/** Address vector */
struct ib_address_vector *av;
/** Attached to multicast GID */
int attached;
/** Multicast group join transaction */
struct ib_mad_transaction *madx;
/** Handle join success/failure
*
* @v membership Multicast group membership
* @v rc Status code
*/
void ( * complete ) ( struct ib_mc_membership *membership, int rc );
};
extern int ib_mcast_join ( struct ib_device *ibdev, struct ib_queue_pair *qp,
struct ib_mc_membership *membership,
struct ib_address_vector *av, unsigned int mask,
void ( * joined ) ( struct ib_mc_membership *memb,
int rc ) );
extern void ib_mcast_leave ( struct ib_device *ibdev, struct ib_queue_pair *qp,
struct ib_mc_membership *membership );
#endif /* _IPXE_IB_MCAST_H */
|
/* A non-interpolating allpass filter class, by John Gibson, 1999.
*/
#if !defined(__Allpass_h)
#define __Allpass_h
#include "DLineN.h"
class Allpass : public JGFilter
{
protected:
DLineN *delayLine;
double allPassCoeff;
double loopt;
public:
Allpass(double srate, double loopTime, double reverbTime);
~Allpass();
void clear();
void setReverbTime(double reverbTime);
double tick(double input);
};
#endif
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CRAZY_LINKER_ELF_RELOCATIONS_H
#define CRAZY_LINKER_ELF_RELOCATIONS_H
#include <string.h>
#include "elf_traits.h"
namespace crazy {
class ElfSymbols;
class ElfView;
class Error;
// An ElfRelocations instance holds information about relocations in a mapped
// ELF binary.
class ElfRelocations {
public:
ElfRelocations() { ::memset(this, 0, sizeof(*this)); }
~ElfRelocations() {}
bool Init(const ElfView* view, Error* error);
// Abstract class used to resolve symbol names into addresses.
// Callers of ::ApplyAll() should pass the address of a derived class
// that properly implements the Lookup() method.
class SymbolResolver {
public:
SymbolResolver() {}
~SymbolResolver() {}
virtual void* Lookup(const char* symbol_name) = 0;
};
// Apply all relocations to the target mapped ELF binary. Must be called
// after Init().
// |symbols| maps to the symbol entries for the target library only.
// |resolver| can resolve symbols out of the current library.
// On error, return false and set |error| message.
bool ApplyAll(const ElfSymbols* symbols,
SymbolResolver* resolver,
Error* error);
// This function is used to adjust relocated addresses in a copy of an
// existing section of an ELF binary. I.e. |src_addr|...|src_addr + size|
// must be inside the mapped ELF binary, this function will first copy its
// content into |dst_addr|...|dst_addr + size|, then adjust all relocated
// addresses inside the destination section as if it was loaded/mapped
// at |map_addr|...|map_addr + size|. Only relative relocations are processed,
// symbolic ones are ignored.
void CopyAndRelocate(size_t src_addr,
size_t dst_addr,
size_t map_addr,
size_t size);
private:
bool ApplyRelocs(const ELF::Rel* relocs,
size_t relocs_count,
const ElfSymbols* symbols,
SymbolResolver* resolver,
Error* error);
#if defined(__mips__)
bool RelocateMipsGot(const ElfSymbols* symbols,
SymbolResolver* resolver,
Error* error);
#endif
const ELF::Phdr* phdr_;
size_t phdr_count_;
size_t load_bias_;
const ELF::Rel* plt_relocations_;
size_t plt_relocations_count_;
ELF::Addr* plt_got_;
const ELF::Rel* relocations_;
size_t relocations_count_;
#if defined(__mips__)
// MIPS-specific relocation fields.
ELF::Word mips_symtab_count_;
ELF::Word mips_local_got_count_;
ELF::Word mips_gotsym_;
#endif
bool has_text_relocations_;
bool has_symbolic_;
};
} // namespace crazy
#endif // CRAZY_LINKER_ELF_RELOCATIONS_H
|
#ifndef _IPXE_SYSLOG_H
#define _IPXE_SYSLOG_H
/** @file
*
* Syslog protocol
*
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <syslog.h>
/** Syslog server port */
#define SYSLOG_PORT 514
/** Syslog line buffer size
*
* This is a policy decision
*/
#define SYSLOG_BUFSIZE 128
/** Syslog default facility
*
* This is a policy decision
*/
#define SYSLOG_DEFAULT_FACILITY 0 /* kernel */
/** Syslog default severity
*
* This is a policy decision
*/
#define SYSLOG_DEFAULT_SEVERITY LOG_INFO
/** Syslog priority */
#define SYSLOG_PRIORITY( facility, severity ) ( 8 * (facility) + (severity) )
extern int syslog_send ( struct interface *xfer, unsigned int severity,
const char *message, const char *terminator );
#endif /* _IPXE_SYSLOG_H */
|
/*****************************************************************************
Copyright (c) 2014, Intel Corp.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************
* Contents: Native high-level C interface to LAPACK function cggbal
* Author: Intel Corporation
* Generated November 2015
*****************************************************************************/
#include "lapacke_utils.h"
lapack_int LAPACKE_cggbal( int matrix_layout, char job, lapack_int n,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* b, lapack_int ldb,
lapack_int* ilo, lapack_int* ihi, float* lscale,
float* rscale )
{
lapack_int info = 0;
/* Additional scalars declarations for work arrays */
lapack_int lwork;
float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_cggbal", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_lsame( job, 'p' ) || LAPACKE_lsame( job, 's' ) ||
LAPACKE_lsame( job, 'b' ) ) {
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
return -4;
}
}
if( LAPACKE_lsame( job, 'p' ) || LAPACKE_lsame( job, 's' ) ||
LAPACKE_lsame( job, 'b' ) ) {
if( LAPACKE_cge_nancheck( matrix_layout, n, n, b, ldb ) ) {
return -6;
}
}
}
#endif
/* Additional scalars initializations for work arrays */
if( LAPACKE_lsame( job, 's' ) || LAPACKE_lsame( job, 'b' ) ) {
lwork = MAX(1,6*n);
} else {
lwork = 1;
}
/* Allocate memory for working array(s) */
work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_cggbal_work( matrix_layout, job, n, a, lda, b, ldb, ilo, ihi,
lscale, rscale, work );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_cggbal", info );
}
return info;
}
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_BASE_SSL_INFO_H_
#define NET_BASE_SSL_INFO_H_
#pragma once
#include <vector>
#include "base/memory/ref_counted.h"
#include "net/base/x509_cert_types.h"
namespace net {
class X509Certificate;
// SSL connection info.
// This is really a struct. All members are public.
class SSLInfo {
public:
SSLInfo();
SSLInfo(const SSLInfo& info);
~SSLInfo();
SSLInfo& operator=(const SSLInfo& info);
void Reset();
bool is_valid() const { return cert != NULL; }
// Adds the specified |error| to the cert status.
void SetCertError(int error);
// The SSL certificate.
scoped_refptr<X509Certificate> cert;
// Bitmask of status info of |cert|, representing, for example, known errors
// and extended validation (EV) status.
// See cert_status_flags.h for values.
int cert_status;
// The security strength, in bits, of the SSL cipher suite.
// 0 means the connection is not encrypted.
// -1 means the security strength is unknown.
int security_bits;
// Information about the SSL connection itself. See
// ssl_connection_status_flags.h for values. The protocol version,
// ciphersuite, and compression in use are encoded within.
int connection_status;
// If the certificate is valid, then this is true iff it was rooted at a
// standard CA root. (As opposed to a user-installed root.)
bool is_issued_by_known_root;
// The hashes of the SubjectPublicKeyInfos from each certificate in the chain.
std::vector<SHA1Fingerprint> public_key_hashes;
};
} // namespace net
#endif // NET_BASE_SSL_INFO_H_
|
#ifndef CR_ENDIAN_H
#define CR_ENDIAN_H
#define CR_LITTLE_ENDIAN 0
#define CR_BIG_ENDIAN 1
#ifdef __cplusplus
extern "C" {
#endif
extern char crDetermineEndianness( void );
#ifdef WINDOWS
typedef __int64 CR64BitType;
#else
#ifndef __STDC__
typedef long long CR64BitType;
#else
typedef struct _CR64BitType
{
unsigned int lo;
unsigned int hi;
} CR64BitType;
#endif
#endif
#define SWAP8(x) x
#define SWAP16(x) (short) ((((x) & 0x00FF) << 8) | (((x) & 0xFF00) >> 8))
#define SWAP32(x) ((((x) & 0x000000FF) << 24) | \
(((x) & 0x0000FF00) << 8) | \
(((x) & 0x00FF0000) >> 8) | \
(((x) & 0xFF000000) >> 24))
#ifdef WINDOWS
#define SWAP64(x) \
((((x) & 0xFF00000000000000L) >> 56) | \
(((x) & 0x00FF000000000000L) >> 40) | \
(((x) & 0x0000FF0000000000L) >> 24) | \
(((x) & 0x000000FF00000000L) >> 8) | \
(((x) & 0x00000000FF000000L) << 8) | \
(((x) & 0x0000000000FF0000L) << 24) | \
(((x) & 0x000000000000FF00L) << 40) | \
(((x) & 0x00000000000000FFL) << 56))
#else
#ifndef __STDC__
#define SWAP64(x) \
x = ((((x) & 0xFF00000000000000LL) >> 56) | \
(((x) & 0x00FF000000000000LL) >> 40) | \
(((x) & 0x0000FF0000000000LL) >> 24) | \
(((x) & 0x000000FF00000000LL) >> 8) | \
(((x) & 0x00000000FF000000LL) << 8) | \
(((x) & 0x0000000000FF0000LL) << 24) | \
(((x) & 0x000000000000FF00LL) << 40) | \
(((x) & 0x00000000000000FFLL) << 56))
#else
#define SWAP64(x) \
{ \
GLubyte *bytes = (GLubyte *) &(x); \
GLubyte tmp = bytes[0]; \
bytes[0] = bytes[7]; \
bytes[7] = tmp; \
tmp = bytes[1]; \
bytes[1] = bytes[6]; \
bytes[6] = tmp; \
tmp = bytes[2]; \
bytes[2] = bytes[5]; \
bytes[5] = tmp; \
tmp = bytes[4]; \
bytes[4] = bytes[3]; \
bytes[3] = tmp; \
}
#endif
#endif
double SWAPDOUBLE( double d );
#define SWAPFLOAT(x) ( ((*((int *) &(x)) & 0x000000FF) << 24) | \
((*((int *) &(x)) & 0x0000FF00) << 8) | \
((*((int *) &(x)) & 0x00FF0000) >> 8) | \
((*((int *) &(x)) & 0xFF000000) >> 24))
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* CR_ENDIAN_H */
|
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_LINUX_VIDEO_CAPTURE_LINUX_H_
#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_LINUX_VIDEO_CAPTURE_LINUX_H_
#include "common_types.h"
#include "../video_capture_impl.h"
namespace webrtc
{
class CriticalSectionWrapper;
class ThreadWrapper;
namespace videocapturemodule
{
class VideoCaptureModuleV4L2: public VideoCaptureImpl
{
public:
VideoCaptureModuleV4L2(int32_t id);
virtual ~VideoCaptureModuleV4L2();
virtual int32_t Init(const char* deviceUniqueId);
virtual int32_t StartCapture(const VideoCaptureCapability& capability);
virtual int32_t StopCapture();
virtual bool CaptureStarted();
virtual int32_t CaptureSettings(VideoCaptureCapability& settings);
private:
enum {kNoOfV4L2Bufffers=4};
static bool CaptureThread(void*);
bool CaptureProcess();
bool AllocateVideoBuffers();
bool DeAllocateVideoBuffers();
ThreadWrapper* _captureThread;
CriticalSectionWrapper* _captureCritSect;
int32_t _deviceId;
int32_t _deviceFd;
int32_t _buffersAllocatedByDevice;
int32_t _currentWidth;
int32_t _currentHeight;
int32_t _currentFrameRate;
bool _captureStarted;
RawVideoType _captureVideoType;
struct Buffer
{
void *start;
size_t length;
};
Buffer *_pool;
};
} // namespace videocapturemodule
} // namespace webrtc
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_LINUX_VIDEO_CAPTURE_LINUX_H_
|
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef QmitkScaleLogarithmicTransformViewWidgetHIncluded
#define QmitkScaleLogarithmicTransformViewWidgetHIncluded
#include "ui_QmitkScaleLogarithmicTransformControls.h"
#include "MitkRigidRegistrationUIExports.h"
#include "QmitkRigidRegistrationTransformsGUIBase.h"
#include <itkImage.h>
/*!
* \brief Widget for rigid registration
*
* Displays options for rigid registration.
*/
class MITK_RIGIDREGISTRATION_UI_EXPORT QmitkScaleLogarithmicTransformView : public QmitkRigidRegistrationTransformsGUIBase
{
public:
QmitkScaleLogarithmicTransformView( QWidget* parent = 0, Qt::WindowFlags f = 0 );
~QmitkScaleLogarithmicTransformView();
virtual mitk::TransformParameters::TransformType GetTransformType();
virtual itk::Object::Pointer GetTransform();
virtual itk::Array<double> GetTransformParameters();
virtual void SetTransformParameters(itk::Array<double> transformValues);
virtual QString GetName();
virtual void SetupUI(QWidget* parent);
virtual itk::Array<double> GetScales();
virtual vtkTransform* Transform(vtkMatrix4x4* vtkmatrix, vtkTransform* vtktransform, itk::Array<double> transformParams);
virtual int GetNumberOfTransformParameters();
private:
template < class TPixelType, unsigned int VImageDimension >
itk::Object::Pointer GetTransform2(itk::Image<TPixelType, VImageDimension>* itkImage1);
protected:
Ui::QmitkScaleLogarithmicTransformControls m_Controls;
itk::Object::Pointer m_TransformObject;
};
#endif
|
/*
* Copyright (c) 2012 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
/* Newlib currently does not have posix_memalign in its headers, though
* the malloc implementation (dlmalloc) does support it.
* http://code.google.com/p/nativeclient/issues/detail?id=2505
*/
#if defined(NEWLIB)
extern int posix_memalign(void **memptr, size_t alignment, size_t size);
#endif
int main(int argc, char* argv[]) {
char *outp;
/* Try a few alignments, some of them might be the standard malloc align.
* They should all be powers of 2 and be a multiple of sizeof(void*).
*/
size_t align_to_test[] = {4, 8, 16, 32, 64, 128, 256, 512, 1024, 0};
size_t sizes_to_test[] = {1, 2, 4, 8, 10, 16, 32, 64, 128, 256, 512, 1024, 0};
int i = 0;
int j = 0;
while (align_to_test[i] != 0) {
j = 0;
while (sizes_to_test[j] != 0) {
int err = posix_memalign((void **)&outp,
align_to_test[i],
sizes_to_test[j] * sizeof(char));
if (err) {
fprintf(stderr,
"posix_memalign failed with err %d (EINVAL=%d,ENOMEM=%d)\n",
err, EINVAL, ENOMEM);
fprintf(stderr, "Input params were align=%d, size=%d\n",
align_to_test[i], sizes_to_test[j]);
return 1;
}
if ((size_t)outp % align_to_test[i] != 0) {
fprintf(stderr, "posix_memalign failed to align to %zu: ptr=%p\n",
align_to_test[i], outp);
return 1;
}
free(outp);
j++;
}
i++;
}
/* Check that a non-power of 2 alignment fails. */
if (posix_memalign((void**)&outp, 7, 20 * sizeof(char)) != EINVAL) {
fprintf(stderr, "posix_memaligned failed to return EINVAL for non-pow2!\n");
return 1;
}
/* Check that smaller than sizeof(void*) alignment fails. */
if (posix_memalign((void**)&outp, sizeof(void*) - 1,
20 * sizeof(char)) != EINVAL) {
fprintf(stderr, "posix_memaligned failed to return EINVAL for non-pow2!\n");
return 1;
}
return 0;
}
|
//
// This source file is part of appleseed.
// Visit http://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited
// Copyright (c) 2014-2017 Francois Beaune, The appleseedhq Organization
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#ifndef APPLESEED_MAIN_DLLSYMBOL_H
#define APPLESEED_MAIN_DLLSYMBOL_H
// appleseed.main headers.
#include "main/dllvisibility.h"
#ifdef appleseed_EXPORTS // automatically set by CMake
#define APPLESEED_DLLSYMBOL APPLESEED_DLL_EXPORT
#else
#define APPLESEED_DLLSYMBOL APPLESEED_DLL_IMPORT
#endif
#endif // !APPLESEED_MAIN_DLLSYMBOL_H
|
//
// This source file is part of appleseed.
// Visit https://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited
// Copyright (c) 2014-2018 Francois Beaune, The appleseedhq Organization
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#pragma once
// appleseed.renderer headers.
#include "renderer/modeling/bsdf/ibsdffactory.h"
// appleseed.foundation headers.
#include "foundation/memory/autoreleaseptr.h"
// appleseed.main headers.
#include "main/dllsymbol.h"
// Forward declarations.
namespace foundation { class Dictionary; }
namespace foundation { class DictionaryArray; }
namespace renderer { class BSDF; }
namespace renderer { class ParamArray; }
namespace renderer
{
//
// Kelemen BRDF factory.
//
class APPLESEED_DLLSYMBOL KelemenBRDFFactory
: public IBSDFFactory
{
public:
// Delete this instance.
void release() override;
// Return a string identifying this BSDF model.
const char* get_model() const override;
// Return metadata for this BSDF model.
foundation::Dictionary get_model_metadata() const override;
// Return metadata for the inputs of this BSDF model.
foundation::DictionaryArray get_input_metadata() const override;
// Create a new BSDF instance.
foundation::auto_release_ptr<BSDF> create(
const char* name,
const ParamArray& params) const override;
};
} // namespace renderer
|
// Copyright 2015 Microsoft Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/ or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//
// This file was generated and any changes will be overwritten.
@class ODURLSessionDataTask;
#import "ODCollectionRequest.h"
@interface ODDriveRecentRequest : ODCollectionRequest
@property (readonly) NSMutableURLRequest *mutableRequest;
- (ODURLSessionDataTask *)executeWithCompletion:(void (^)(ODCollection *response, ODDriveRecentRequest *nextRequest, NSError *error))completionHandler;
@end
|
/*****************************************************************************/
/* */
/* Copyright (c) 1989-2008 Morgan Stanley All rights reserved.*/
/* See .../src/LICENSE for terms of distribution. */
/* */
/* */
/*****************************************************************************/
/* contributed by Daniel F. Fisher */
/*
* cuts head circular list before h and inserts new circular list, making
* large circular list. This operation is semetrical with respect to
* interchange of h and p.
*/
/* header file inclusions */
#include <dap/node.h>
/* external function definitions */
void
nodeinsert(struct node * p, struct node * h)
{
if ((p != (struct node *) (0))
&& (h != (struct node *) (0))) {
struct node *t = p->b; /* temporary node */
p->b->f = h;
p->b = h->b;
h->b->f = p;
h->b = t;
}
return;
}
|
/***********************************************************************
filename: CEGUIDefaultWindow.h
created: 5/6/2004
author: Paul D Turner
purpose: Interface to a default window
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
*
* 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
***************************************************************************/
#ifndef _CEGUIDefaultWindow_h_
#define _CEGUIDefaultWindow_h_
#include "../Window.h"
#include "../WindowFactory.h"
// Start of CEGUI namespace section
namespace CEGUI
{
/*!
\brief
Window class intended to be used as a simple, generic Window.
This class does no rendering and so appears totally transparent. This window defaults
to position 0.0f, 0.0f with a size of 1.0f x 1.0f.
/par
This Window has been used as the root GUI-sheet (root window) but it's usage has been extended
beyond that. That's why it's name has been changed to "DefaultWindow" for 0.8.
*/
class CEGUIEXPORT DefaultWindow : public Window
{
public:
/*************************************************************************
Constants
*************************************************************************/
// type name for this widget
static const String WidgetTypeName; //!< The unique typename of this widget
/*************************************************************************
Construction and Destruction
*************************************************************************/
/*!
\brief
Constructor for DefaultWindows.
*/
DefaultWindow(const String& type, const String& name);
/*!
\brief
Destructor for DefaultWindows.
*/
virtual ~DefaultWindow(void) {}
protected:
//! helper to update mouse input handled state
void updateMouseEventHandled(MouseEventArgs& e) const;
// overridden functions from Window base class
bool moveToFront_impl(bool wasClicked);
// override the mouse event handlers
void onMouseMove(MouseEventArgs& e);
void onMouseWheel(MouseEventArgs& e);
void onMouseButtonDown(MouseEventArgs& e);
void onMouseButtonUp(MouseEventArgs& e);
void onMouseClicked(MouseEventArgs& e);
void onMouseDoubleClicked(MouseEventArgs& e);
void onMouseTripleClicked(MouseEventArgs& e);
};
} // End of CEGUI namespace section
#endif // end of guard _CEGUIDefaultWindow_h_
|
/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef VPLUGIN_H
#define VPLUGIN_H
#include "edl.inc"
#include "plugin.h"
#include "pluginset.inc"
class VPlugin : public Plugin
{
public:
VPlugin(EDL *edl, PluginSet *plugin_set);
~VPlugin();
};
#endif
|
/*
Copyright (c) 2013, 2018, Oracle and/or its affiliates. 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.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
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, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef TABLE_REPLICATION_APPLIER_STATUS_H
#define TABLE_REPLICATION_APPLIER_STATUS_H
/**
@file storage/perfschema/table_replication_applier_status.h
Table replication_applier_status (declarations).
*/
#include "pfs_column_types.h"
#include "pfs_engine_table.h"
#include "rpl_mi.h"
#include "mysql_com.h"
#include "rpl_msr.h"
#include "rpl_info.h" /*CHANNEL_NAME_LENGTH*/
class Master_info;
/**
@addtogroup Performance_schema_tables
@{
*/
#ifndef ENUM_RPL_YES_NO
#define ENUM_RPL_YES_NO
/** enum values for Service_State field*/
enum enum_rpl_yes_no {
PS_RPL_YES= 1,
PS_RPL_NO
};
#endif
/** A row in the table. */
struct st_row_applier_status {
char channel_name[CHANNEL_NAME_LENGTH];
uint channel_name_length;
enum_rpl_yes_no service_state;
uint remaining_delay;
bool remaining_delay_is_set;
ulong count_transactions_retries;
};
/** Table PERFORMANCE_SCHEMA.replication_applier_status */
class table_replication_applier_status: public PFS_engine_table
{
typedef PFS_simple_index pos_t;
private:
void make_row(Master_info *mi);
/** Table share lock. */
static THR_LOCK m_table_lock;
/** Fields definition. */
static TABLE_FIELD_DEF m_field_def;
/** Current row */
st_row_applier_status m_row;
/** True is the current row exists. */
bool m_row_exists;
/** Current position. */
pos_t m_pos;
/** Next position. */
pos_t m_next_pos;
protected:
/**
Read the current row values.
@param table Table handle
@param buf row buffer
@param fields Table fields
@param read_all true if all columns are read.
*/
virtual int read_row_values(TABLE *table,
unsigned char *buf,
Field **fields,
bool read_all);
table_replication_applier_status();
public:
~table_replication_applier_status();
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
static ha_rows get_row_count();
virtual int rnd_next();
virtual int rnd_pos(const void *pos);
virtual void reset_position(void);
};
/** @} */
#endif
|
/* vi: set sw=4 ts=4: */
/*
* Mini chvt implementation for busybox
*
* Copyright (C) 1999-2004 by Erik Andersen <[email protected]>
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
//config:config CHVT
//config: bool "chvt (2 kb)"
//config: default y
//config: help
//config: This program is used to change to another terminal.
//config: Example: chvt 4 (change to terminal /dev/tty4)
//applet:IF_CHVT(APPLET_NOEXEC(chvt, chvt, BB_DIR_USR_BIN, BB_SUID_DROP, chvt))
//kbuild:lib-$(CONFIG_CHVT) += chvt.o
//usage:#define chvt_trivial_usage
//usage: "N"
//usage:#define chvt_full_usage "\n\n"
//usage: "Change the foreground virtual terminal to /dev/ttyN"
#include "libbb.h"
int chvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int chvt_main(int argc UNUSED_PARAM, char **argv)
{
int num = xatou_range(single_argv(argv), 1, 63);
console_make_active(get_console_fd_or_die(), num);
return EXIT_SUCCESS;
}
|
/* $Xorg: OMWrap.c,v 1.4 2000/08/17 19:44:47 cpqbld Exp $ */
/*
* Copyright 1992, 1993 by TOSHIBA Corp.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of TOSHIBA not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission. TOSHIBA make no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* TOSHIBA DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
* TOSHIBA BE LIABLE FOR ANY SPECIAL, 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.
*
* Author: Katsuhisa Yano TOSHIBA Corp.
* [email protected]
*/
/* $XFree86: xc/lib/X11/OMWrap.c,v 1.4 2001/07/25 15:04:44 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
#include "Xlcint.h"
XOM
XOpenOM(Display *dpy, XrmDatabase rdb, _Xconst char *res_name,
_Xconst char *res_class)
{
XLCd lcd = _XOpenLC((char *) NULL);
if (lcd == NULL)
return (XOM) NULL;
if (lcd->methods->open_om)
return (*lcd->methods->open_om)(lcd, dpy, rdb, res_name, res_class);
return (XOM) NULL;
}
Status
XCloseOM(om)
XOM om;
{
XOC oc, next;
XLCd lcd = om->core.lcd;
next = om->core.oc_list;
while ((oc = next)) {
next = oc->core.next;
(*oc->methods->destroy)(oc);
}
om->core.oc_list = NULL;
_XCloseLC(lcd);
return (*om->methods->close)(om);
}
char *
XSetOMValues(XOM om, ...)
{
va_list var;
XlcArgList args;
char *ret;
int num_args;
va_start(var, om);
_XlcCountVaList(var, &num_args);
va_end(var);
va_start(var, om);
_XlcVaToArgList(var, num_args, &args);
va_end(var);
if (args == (XlcArgList) NULL)
return (char *) NULL;
ret = (*om->methods->set_values)(om, args, num_args);
Xfree(args);
return ret;
}
char *
XGetOMValues(XOM om, ...)
{
va_list var;
XlcArgList args;
char *ret;
int num_args;
va_start(var, om);
_XlcCountVaList(var, &num_args);
va_end(var);
va_start(var, om);
_XlcVaToArgList(var, num_args, &args);
va_end(var);
if (args == (XlcArgList) NULL)
return (char *) NULL;
ret = (*om->methods->get_values)(om, args, num_args);
Xfree(args);
return ret;
}
Display *
XDisplayOfOM(om)
XOM om;
{
return om->core.display;
}
char *
XLocaleOfOM(om)
XOM om;
{
return om->core.lcd->core->name;
}
|
#ifndef SSLOPT_LONGOPTS_INCLUDED
#define SSLOPT_LONGOPTS_INCLUDED
/*
Copyright (c) 2000, 2010, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
{"ssl", OPT_SSL_SSL,
"Enable SSL for connection (automatically enabled with other flags).",
&opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"ssl-ca", OPT_SSL_CA,
"CA file in PEM format (check OpenSSL docs, implies --ssl).",
&opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-capath", OPT_SSL_CAPATH,
"CA directory (check OpenSSL docs, implies --ssl).",
&opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).",
&opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).",
&opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
&opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-crl", OPT_SSL_KEY, "Certificate revocation list (implies --ssl).",
&opt_ssl_crl, &opt_ssl_crl, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-crlpath", OPT_SSL_KEY,
"Certificate revocation list path (implies --ssl).",
&opt_ssl_crlpath, &opt_ssl_crlpath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"tls-version", OPT_TLS_VERSION,
"TLS protocol version for secure connection.",
&opt_tls_version, &opt_tls_version, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifdef MYSQL_CLIENT
{"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT,
"Verify server's \"Common Name\" in its cert against hostname used "
"when connecting. This option is disabled by default.",
&opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert,
0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
#endif /* HAVE_OPENSSL */
#endif /* SSLOPT_LONGOPTS_INCLUDED */
|
/*
* $Id: logfile_mod_stdio.c,v 1.1.2.1 2008/06/04 20:36:17 hno Exp $
*
* DEBUG: section 50 Log file handling
* AUTHOR: Duane Wessels
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
* ----------------------------------------------------------
*
* Squid is the result of efforts by numerous individuals from
* the Internet community; see the CONTRIBUTORS file for full
* details. Many organizations have provided support for Squid's
* development; see the SPONSORS file for full details. Squid is
* Copyrighted (C) 2001 by the Regents of the University of
* California; see the COPYRIGHT file for full details. Squid
* incorporates software developed and/or copyrighted by other
* sources; see the CREDITS file for full details.
*
* 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, USA.
*
*/
#include "squid.h"
#include "logfile_mod_stdio.h"
typedef struct {
int fd;
char *buf;
int bufsz;
int offset;
} l_stdio_t;
/*
* Aborts with fatal message if write() returns something other
* than its length argument.
*/
static void
logfileWriteWrapper(Logfile * lf, const void *buf, size_t len)
{
l_stdio_t *ll = (l_stdio_t *) lf->data;
size_t s;
s = FD_WRITE_METHOD(ll->fd, (char const *) buf, len);
fd_bytes(ll->fd, s, FD_WRITE);
if (s == len)
return;
if (!lf->flags.fatal)
return;
fatalf("logfileWrite (stdio): %s: %s\n", lf->path, xstrerror());
}
static void
logfile_mod_stdio_writeline(Logfile * lf, const char *buf, size_t len)
{
l_stdio_t *ll = (l_stdio_t *) lf->data;
if (0 == ll->bufsz) {
/* buffering disabled */
logfileWriteWrapper(lf, buf, len);
return;
}
if (ll->offset > 0 && ll->offset + len > ll->bufsz)
logfileFlush(lf);
if (len > ll->bufsz) {
/* too big to fit in buffer */
logfileWriteWrapper(lf, buf, len);
return;
}
/* buffer it */
xmemcpy(ll->buf + ll->offset, buf, len);
ll->offset += len;
assert(ll->offset >= 0);
assert((size_t) ll->offset <= ll->bufsz);
}
static void
logfile_mod_stdio_linestart(Logfile * lf)
{
}
static void
logfile_mod_stdio_lineend(Logfile * lf)
{
lf->f_flush(lf);
}
static void
logfile_mod_stdio_flush(Logfile * lf)
{
l_stdio_t *ll = (l_stdio_t *) lf->data;
if (0 == ll->offset)
return;
logfileWriteWrapper(lf, ll->buf, (size_t) ll->offset);
ll->offset = 0;
}
static void
logfile_mod_stdio_rotate(Logfile * lf)
{
#ifdef S_ISREG
struct stat sb;
#endif
int i;
char from[MAXPATHLEN];
char to[MAXPATHLEN];
l_stdio_t *ll = (l_stdio_t *) lf->data;
assert(lf->path);
#ifdef S_ISREG
if (stat(lf->path, &sb) == 0)
if (S_ISREG(sb.st_mode) == 0)
return;
#endif
debug(0, 1) ("logfileRotate (stdio): %s\n", lf->path);
/* Rotate numbers 0 through N up one */
for (i = Config.Log.rotateNumber; i > 1;) {
i--;
snprintf(from, MAXPATHLEN, "%s.%d", lf->path, i - 1);
snprintf(to, MAXPATHLEN, "%s.%d", lf->path, i);
xrename(from, to);
}
/* Rotate the current log to .0 */
logfileFlush(lf);
file_close(ll->fd); /* always close */
if (Config.Log.rotateNumber > 0) {
snprintf(to, MAXPATHLEN, "%s.%d", lf->path, 0);
xrename(lf->path, to);
}
/* Reopen the log. It may have been renamed "manually" */
ll->fd = file_open(lf->path, O_WRONLY | O_CREAT | O_TEXT);
if (DISK_ERROR == ll->fd && lf->flags.fatal) {
debug(50, 1) ("logfileRotate (stdio): %s: %s\n", lf->path, xstrerror());
fatalf("Cannot open %s: %s", lf->path, xstrerror());
}
}
static void
logfile_mod_stdio_close(Logfile * lf)
{
l_stdio_t *ll = (l_stdio_t *) lf->data;
lf->f_flush(lf);
if (ll->fd >= 0)
file_close(ll->fd);
if (ll->buf)
xfree(ll->buf);
xfree(lf->data);
lf->data = NULL;
}
/*
* This code expects the path to be syslog:<priority>
*/
int
logfile_mod_stdio_open(Logfile * lf, const char *path, size_t bufsz, int fatal_flag)
{
l_stdio_t *ll;
lf->f_close = logfile_mod_stdio_close;
lf->f_linewrite = logfile_mod_stdio_writeline;
lf->f_linestart = logfile_mod_stdio_linestart;
lf->f_lineend = logfile_mod_stdio_lineend;
lf->f_flush = logfile_mod_stdio_flush;
lf->f_rotate = logfile_mod_stdio_rotate;
ll = xcalloc(1, sizeof(*ll));
lf->data = ll;
ll->fd = file_open(path, O_WRONLY | O_CREAT | O_TEXT);
if (DISK_ERROR == ll->fd) {
if (ENOENT == errno && fatal_flag) {
fatalf("Cannot open '%s' because\n"
"\tthe parent directory does not exist.\n"
"\tPlease create the directory.\n", path);
} else if (EACCES == errno && fatal_flag) {
fatalf("Cannot open '%s' for writing.\n"
"\tThe parent directory must be writeable by the\n"
"\tuser '%s', which is the cache_effective_user\n"
"\tset in squid.conf.", path, Config.effectiveUser);
} else {
debug(50, 1) ("logfileOpen (stdio): %s: %s\n", path, xstrerror());
return 0;
}
}
if (bufsz > 0) {
ll->buf = (char *) xmalloc(bufsz);
ll->bufsz = bufsz;
}
return 1;
}
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef GLK_ZCODE_BITMAP_FONT
#define GLK_ZCODE_BITMAP_FONT
#include "common/array.h"
#include "common/rect.h"
#include "graphics/font.h"
#include "graphics/managed_surface.h"
namespace Glk {
namespace ZCode {
/**
* Implements a font stored as a grid on a passed surface
*/
class BitmapFont : public Graphics::Font {
private:
Common::Array<Graphics::ManagedSurface> _chars;
size_t _startingChar;
Common::Point _size;
protected:
/**
* Calculate a character width
*/
int getSourceCharacterWidth(uint charIndex, const Graphics::Surface &src,
const Common::Rect &charBounds);
/**
* Constructor
*/
BitmapFont(const Graphics::Surface &src, const Common::Point &size,
uint srcWidth, uint srcHeight, unsigned char startingChar, bool isFixedWidth);
public:
/**
* Get the font height
*/
int getFontHeight() const override { return _size.y; }
/**
* Get the maximum character width
*/
int getMaxCharWidth() const override { return _size.x; }
/**
* Get the width of the given character
*/
int getCharWidth(uint32 chr) const override { return _chars[chr - _startingChar].w; }
/**
* Draw a character
*/
void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override;
};
/**
* Subclass for fixed width fonts
*/
class FixedWidthBitmapFont : public BitmapFont {
public:
/**
* Constructor
*/
FixedWidthBitmapFont(const Graphics::Surface &src, const Common::Point &size,
uint srcWidth = 8, uint srcHeight = 8, unsigned char startingChar = ' ') :
BitmapFont(src, size, srcWidth, srcHeight, startingChar, true) {}
};
/**
* Subclass for fixed width fonts
*/
class VariableWidthBitmapFont : public BitmapFont {
public:
/**
* Constructor
*/
VariableWidthBitmapFont(const Graphics::Surface &src, const Common::Point &size,
uint srcWidth = 8, uint srcHeight = 8, unsigned char startingChar = ' ') :
BitmapFont(src, size, srcWidth, srcHeight, startingChar, false) {}
};
} // End of namespace ZCode
} // End of namespace Glk
#endif
|
/*
* Testing tool for ASN.1 routines
* Copyright (c) 2006-2009, Jouni Malinen <[email protected]>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
*/
#include "includes.h"
#include "common.h"
#include "tls/asn1.h"
extern int wpa_debug_level;
static const char * asn1_class_str(int class)
{
switch (class) {
case ASN1_CLASS_UNIVERSAL:
return "Universal";
case ASN1_CLASS_APPLICATION:
return "Application";
case ASN1_CLASS_CONTEXT_SPECIFIC:
return "Context-specific";
case ASN1_CLASS_PRIVATE:
return "Private";
default:
return "?";
}
}
int asn1_parse(const u8 *buf, size_t len, int level)
{
const u8 *pos, *prev, *end;
char prefix[10], str[100];
int _level;
struct asn1_hdr hdr;
struct asn1_oid oid;
u8 tmp;
_level = level;
if ((size_t) _level > sizeof(prefix) - 1)
_level = sizeof(prefix) - 1;
memset(prefix, ' ', _level);
prefix[_level] = '\0';
pos = buf;
end = buf + len;
while (pos < end) {
if (asn1_get_next(pos, end - pos, &hdr) < 0)
return -1;
prev = pos;
pos = hdr.payload;
wpa_printf(MSG_MSGDUMP, "ASN.1:%s Class %d(%s) P/C %d(%s) "
"Tag %u Length %u",
prefix, hdr.class, asn1_class_str(hdr.class),
hdr.constructed,
hdr.constructed ? "Constructed" : "Primitive",
hdr.tag, hdr.length);
if (hdr.class == ASN1_CLASS_CONTEXT_SPECIFIC &&
hdr.constructed) {
if (asn1_parse(pos, hdr.length, level + 1) < 0)
return -1;
pos += hdr.length;
}
if (hdr.class != ASN1_CLASS_UNIVERSAL)
continue;
switch (hdr.tag) {
case ASN1_TAG_EOC:
if (hdr.length) {
wpa_printf(MSG_DEBUG, "ASN.1: Non-zero "
"end-of-contents length (%u)",
hdr.length);
return -1;
}
wpa_printf(MSG_MSGDUMP, "ASN.1:%s EOC", prefix);
break;
case ASN1_TAG_BOOLEAN:
if (hdr.length != 1) {
wpa_printf(MSG_DEBUG, "ASN.1: Unexpected "
"Boolean length (%u)", hdr.length);
return -1;
}
tmp = *pos++;
wpa_printf(MSG_MSGDUMP, "ASN.1:%s Boolean %s",
prefix, tmp ? "TRUE" : "FALSE");
break;
case ASN1_TAG_INTEGER:
wpa_hexdump(MSG_MSGDUMP, "ASN.1: INTEGER",
pos, hdr.length);
pos += hdr.length;
break;
case ASN1_TAG_BITSTRING:
wpa_hexdump(MSG_MSGDUMP, "ASN.1: BitString",
pos, hdr.length);
pos += hdr.length;
break;
case ASN1_TAG_OCTETSTRING:
wpa_hexdump(MSG_MSGDUMP, "ASN.1: OctetString",
pos, hdr.length);
pos += hdr.length;
break;
case ASN1_TAG_NULL:
if (hdr.length) {
wpa_printf(MSG_DEBUG, "ASN.1: Non-zero Null "
"length (%u)", hdr.length);
return -1;
}
wpa_printf(MSG_MSGDUMP, "ASN.1:%s Null", prefix);
break;
case ASN1_TAG_OID:
if (asn1_get_oid(prev, end - prev, &oid, &prev) < 0) {
wpa_printf(MSG_DEBUG, "ASN.1: Invalid OID");
return -1;
}
asn1_oid_to_str(&oid, str, sizeof(str));
wpa_printf(MSG_DEBUG, "ASN.1:%s OID %s", prefix, str);
pos += hdr.length;
break;
case ANS1_TAG_RELATIVE_OID:
wpa_hexdump(MSG_MSGDUMP, "ASN.1: Relative OID",
pos, hdr.length);
pos += hdr.length;
break;
case ASN1_TAG_SEQUENCE:
wpa_printf(MSG_MSGDUMP, "ASN.1:%s SEQUENCE", prefix);
if (asn1_parse(pos, hdr.length, level + 1) < 0)
return -1;
pos += hdr.length;
break;
case ASN1_TAG_SET:
wpa_printf(MSG_MSGDUMP, "ASN.1:%s SET", prefix);
if (asn1_parse(pos, hdr.length, level + 1) < 0)
return -1;
pos += hdr.length;
break;
case ASN1_TAG_PRINTABLESTRING:
wpa_hexdump_ascii(MSG_MSGDUMP,
"ASN.1: PrintableString",
pos, hdr.length);
pos += hdr.length;
break;
case ASN1_TAG_IA5STRING:
wpa_hexdump_ascii(MSG_MSGDUMP, "ASN.1: IA5String",
pos, hdr.length);
pos += hdr.length;
break;
case ASN1_TAG_UTCTIME:
wpa_hexdump_ascii(MSG_MSGDUMP, "ASN.1: UTCTIME",
pos, hdr.length);
pos += hdr.length;
break;
case ASN1_TAG_VISIBLESTRING:
wpa_hexdump_ascii(MSG_MSGDUMP, "ASN.1: VisibleString",
pos, hdr.length);
pos += hdr.length;
break;
default:
wpa_printf(MSG_DEBUG, "ASN.1: Unknown tag %d",
hdr.tag);
return -1;
}
}
return 0;
}
int main(int argc, char *argv[])
{
FILE *f;
u8 buf[3000];
size_t len;
wpa_debug_level = 0;
f = fopen(argv[1], "rb");
if (f == NULL)
return -1;
len = fread(buf, 1, sizeof(buf), f);
fclose(f);
if (asn1_parse(buf, len, 0) < 0)
printf("Failed to parse DER ASN.1\n");
printf("\n\n");
return 0;
}
|
/*
* Copyright (C) 2010 Samsung Electronics. 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.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef __LINUX_GP2A_H
#define __LINUX_GP2A_H
#include <linux/types.h>
#ifdef __KERNEL__
#define GP2A_OPT "gp2a-opt"
struct gp2a_platform_data {
int p_out; /* proximity-sensor-output gpio */
#ifdef CONFIG_SAMSUNG_FASCINATE
int p_irq;
#endif
int (*power)(bool); /* power to the chip */
int (*light_adc_value)(void); /* get light level from adc */
};
#endif /* __KERNEL__ */
#endif
|
/*
* machine_kexec.c - handle transition of Linux booting another kernel
*/
#include <linux/mm.h>
#include <linux/kexec.h>
#include <linux/delay.h>
#include <linux/reboot.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/memblock.h>
#include <asm/pgtable.h>
#include <linux/of_fdt.h>
#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
#include <asm/cacheflush.h>
#include <asm/mach-types.h>
#include <asm/system_misc.h>
extern const unsigned char relocate_new_kernel[];
extern const unsigned int relocate_new_kernel_size;
extern unsigned long kexec_start_address;
extern unsigned long kexec_indirection_page;
extern unsigned long kexec_mach_type;
extern unsigned long kexec_boot_atags;
static atomic_t waiting_for_crash_ipi;
/*
* Provide a dummy crash_notes definition while crash dump arrives to arm.
* This prevents breakage of crash_notes attribute in kernel/ksysfs.c.
*/
int machine_kexec_prepare(struct kimage *image)
{
struct kexec_segment *current_segment;
__be32 header;
int i, err;
/*
* No segment at default ATAGs address. try to locate
* a dtb using magic.
*/
for (i = 0; i < image->nr_segments; i++) {
current_segment = &image->segment[i];
if (!memblock_is_region_memory(current_segment->mem,
current_segment->memsz))
return -EINVAL;
err = get_user(header, (__be32*)current_segment->buf);
if (err)
return err;
if (be32_to_cpu(header) == OF_DT_HEADER)
kexec_boot_atags = current_segment->mem;
}
return 0;
}
void machine_kexec_cleanup(struct kimage *image)
{
}
void machine_crash_nonpanic_core(void *unused)
{
struct pt_regs regs;
crash_setup_regs(®s, NULL);
printk(KERN_DEBUG "CPU %u will stop doing anything useful since another CPU has crashed\n",
smp_processor_id());
crash_save_cpu(®s, smp_processor_id());
flush_cache_all();
atomic_dec(&waiting_for_crash_ipi);
while (1)
cpu_relax();
}
static void machine_kexec_mask_interrupts(void)
{
unsigned int i;
struct irq_desc *desc;
for_each_irq_desc(i, desc) {
struct irq_chip *chip;
chip = irq_desc_get_chip(desc);
if (!chip)
continue;
if (chip->irq_eoi && irqd_irq_inprogress(&desc->irq_data))
chip->irq_eoi(&desc->irq_data);
if (chip->irq_mask)
chip->irq_mask(&desc->irq_data);
if (chip->irq_disable && !irqd_irq_disabled(&desc->irq_data))
chip->irq_disable(&desc->irq_data);
}
}
void machine_crash_shutdown(struct pt_regs *regs)
{
unsigned long msecs;
local_irq_disable();
atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
smp_call_function(machine_crash_nonpanic_core, NULL, false);
msecs = 1000; /* Wait at most a second for the other cpus to stop */
while ((atomic_read(&waiting_for_crash_ipi) > 0) && msecs) {
mdelay(1);
msecs--;
}
if (atomic_read(&waiting_for_crash_ipi) > 0)
printk(KERN_WARNING "Non-crashing CPUs did not react to IPI\n");
crash_save_cpu(regs, smp_processor_id());
machine_kexec_mask_interrupts();
printk(KERN_INFO "Loading crashdump kernel...\n");
}
/*
* Function pointer to optional machine-specific reinitialization
*/
void (*kexec_reinit)(void);
void machine_kexec(struct kimage *image)
{
unsigned long page_list;
unsigned long reboot_code_buffer_phys;
void *reboot_code_buffer;
page_list = image->head & PAGE_MASK;
/* we need both effective and real address here */
reboot_code_buffer_phys =
page_to_pfn(image->control_code_page) << PAGE_SHIFT;
reboot_code_buffer = page_address(image->control_code_page);
/* Prepare parameters for reboot_code_buffer*/
kexec_start_address = image->start;
kexec_indirection_page = page_list;
kexec_mach_type = machine_arch_type;
if (!kexec_boot_atags)
kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET;
/* copy our kernel relocation code to the control code page */
memcpy(reboot_code_buffer,
relocate_new_kernel, relocate_new_kernel_size);
flush_icache_range((unsigned long) reboot_code_buffer,
(unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
printk(KERN_INFO "Bye!\n");
if (kexec_reinit)
kexec_reinit();
soft_restart(reboot_code_buffer_phys);
}
void arch_crash_save_vmcoreinfo(void)
{
#ifdef CONFIG_ARM_LPAE
VMCOREINFO_CONFIG(ARM_LPAE);
#endif
}
|
/* Copyright (C) 2015-2017 Sergey V. Mikayev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or
* (at your option) any later version.
*
* This 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SOXR_ADAPTER_H
#define SOXR_ADAPTER_H
#include <soxr.h>
#include "../SampleRateConverter.h"
namespace MT32Emu {
class SoxrAdapter {
public:
SoxrAdapter(Synth &synth, double targetSampleRate, SampleRateConverter::Quality quality);
~SoxrAdapter();
void getOutputSamples(float *buffer, unsigned int length);
private:
Synth &synth;
float * const inBuffer;
soxr_t resampler;
static size_t getInputSamples(void *input_fn_state, soxr_in_t *data, size_t requested_len);
};
} // namespace MT32Emu
#endif // SOXR_ADAPTER_H
|
/*
* SNOOPY LOGGER
*
* File: snoopy/datasource/tid_kernel.c
*
* Copyright (c) 2015 Bostjan Skufca <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
* Includes order: from local to global
*/
#define _GNU_SOURCE
#include "tid_kernel.h"
#include "snoopy.h"
#include <stdio.h>
#include <unistd.h>
#include <sys/syscall.h>
/*
* SNOOPY DATA SOURCE: tid_kernel
*
* Description:
* Returns tid (thread ID) of current process. Queries kernel for it via
* syscall SYS_gettid.
*
* Params:
* result: pointer to string, to write result into
* arg: (ignored)
*
* Return:
* number of characters in the returned string, or SNOOPY_DATASOURCE_FAILURE
*/
int snoopy_datasource_tid_kernel (char * const result, char const * const arg)
{
pid_t tid = syscall(SYS_gettid);
// This happens if -lpthread is not given to compiler
if (0 == (unsigned long int)tid) {
return snprintf(result, SNOOPY_DATASOURCE_MESSAGE_MAX_SIZE, "(error @ syscall(SYS_gettid))");
}
return snprintf(result, SNOOPY_DATASOURCE_MESSAGE_MAX_SIZE, "%lu", (unsigned long int)tid);
}
|
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2015 Vladimir Golovnev <[email protected]>
* Copyright (C) 2010 Christophe Dumez <[email protected]>
*
* 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.
*
* In addition, as a special exception, the copyright holders give permission to
* link this program with the OpenSSL project's "OpenSSL" library (or with
* modified versions of it that use the same license as the "OpenSSL" library),
* and distribute the linked executables. You must obey the GNU General Public
* License in all respects for all of the code used other than "OpenSSL". If you
* modify file(s), you may extend this exception to your version of the file(s),
* but you are not obligated to do so. If you do not wish to do so, delete this
* exception statement from your version.
*
* Contact : [email protected]
*/
#ifndef TORRENTMODEL_H
#define TORRENTMODEL_H
#include <QAbstractListModel>
#include <QList>
namespace BitTorrent
{
class InfoHash;
class TorrentHandle;
}
class TorrentModel : public QAbstractListModel
{
Q_OBJECT
Q_DISABLE_COPY(TorrentModel)
public:
enum Column
{
TR_PRIORITY,
TR_NAME,
TR_SIZE,
TR_TOTAL_SIZE,
TR_PROGRESS,
TR_STATUS,
TR_SEEDS,
TR_PEERS,
TR_DLSPEED,
TR_UPSPEED,
TR_ETA,
TR_RATIO,
TR_CATEGORY,
TR_ADD_DATE,
TR_SEED_DATE,
TR_TRACKER,
TR_DLLIMIT,
TR_UPLIMIT,
TR_AMOUNT_DOWNLOADED,
TR_AMOUNT_UPLOADED,
TR_AMOUNT_DOWNLOADED_SESSION,
TR_AMOUNT_UPLOADED_SESSION,
TR_AMOUNT_LEFT,
TR_TIME_ELAPSED,
TR_SAVE_PATH,
TR_COMPLETED,
TR_RATIO_LIMIT,
TR_SEEN_COMPLETE_DATE,
TR_LAST_ACTIVITY,
NB_COLUMNS
};
explicit TorrentModel(QObject *parent = 0);
int rowCount(const QModelIndex& index = QModelIndex()) const;
int columnCount(const QModelIndex &parent=QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::DisplayRole);
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
BitTorrent::TorrentHandle *torrentHandle(const QModelIndex &index) const;
private slots:
void addTorrent(BitTorrent::TorrentHandle *const torrent);
void handleTorrentAboutToBeRemoved(BitTorrent::TorrentHandle *const torrent);
void handleTorrentStatusUpdated(BitTorrent::TorrentHandle *const torrent);
void handleTorrentsUpdated();
private:
QList<BitTorrent::TorrentHandle *> m_torrents;
};
#endif // TORRENTMODEL_H
|
/*
Copyright (c) 2013, 2018, Oracle and/or its affiliates. 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.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
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, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef TABLE_REPLICATION_APPLIER_STATUS_BY_COORDINATOR_H
#define TABLE_REPLICATION_APPLIER_STATUS_BY_COORDINATOR_H
/**
@file storage/perfschema/table_replication_applier_applier_by_coordinator.h
Table replication_applier_status_by_coordinator(declarations).
*/
#include "pfs_column_types.h"
#include "pfs_engine_table.h"
#include "rpl_mi.h"
#include "mysql_com.h"
#include "rpl_msr.h"
#include "rpl_info.h" /*CHANNEL_NAME_LENGTH*/
class Master_info;
/**
@addtogroup Performance_schema_tables
@{
*/
#ifndef ENUM_RPL_YES_NO
#define ENUM_RPL_YES_NO
/** enum values for Service_State of coordinator thread */
enum enum_rpl_yes_no {
PS_RPL_YES= 1, /* Service_State= on */
PS_RPL_NO /* Service_State= off */
};
#endif
/*
A row in coordinator's table. The fields with string values have an
additional length field denoted by <field_name>_length.
*/
struct st_row_coordinator {
char channel_name[CHANNEL_NAME_LENGTH];
uint channel_name_length;
ulonglong thread_id;
bool thread_id_is_null;
enum_rpl_yes_no service_state;
uint last_error_number;
char last_error_message[MAX_SLAVE_ERRMSG];
uint last_error_message_length;
ulonglong last_error_timestamp;
};
/** Table PERFORMANCE_SCHEMA.replication_applier_status_by_coordinator */
class table_replication_applier_status_by_coordinator: public PFS_engine_table
{
typedef PFS_simple_index pos_t;
private:
void make_row(Master_info *mi);
/** Table share lock. */
static THR_LOCK m_table_lock;
/** Fields definition. */
static TABLE_FIELD_DEF m_field_def;
/** Current row */
st_row_coordinator m_row;
/** True is the current row exists. */
bool m_row_exists;
/** Current position. */
pos_t m_pos;
/** Next position. */
pos_t m_next_pos;
protected:
/**
Read the current row values.
@param table Table handle
@param buf row buffer
@param fields Table fields
@param read_all true if all columns are read.
*/
virtual int read_row_values(TABLE *table,
unsigned char *buf,
Field **fields,
bool read_all);
table_replication_applier_status_by_coordinator();
public:
~table_replication_applier_status_by_coordinator();
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
static ha_rows get_row_count();
virtual int rnd_next();
virtual int rnd_pos(const void *pos);
virtual void reset_position(void);
};
/** @} */
#endif
|
/* Definitions for POSIX memory map interface. Linux/Nios II version.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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/>. */
#ifndef _SYS_MMAN_H
# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
#endif
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
/* These are Linux-specific. */
#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
# define MAP_DENYWRITE 0x00800 /* ETXTBSY */
# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
# define MAP_LOCKED 0x02000 /* Lock the mapping. */
# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#endif
/* Include generic Linux declarations. */
#include <bits/mman-linux.h>
|
/*
* ppp-comp.h - Definitions for doing PPP packet compression.
*
* Copyright (c) 1994 The Australian National University.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation is hereby granted, provided that the above copyright
* notice appears in all copies. This software is provided without any
* warranty, express or implied. The Australian National University
* makes no representations about the suitability of this software for
* any purpose.
*
* IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
* PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
* THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
* OR MODIFICATIONS.
*
* $Id: ppp-comp.h,v 1.1.1.1 1999-11-22 03:47:53 christ Exp $
*/
#ifndef _NET_PPP_COMP_H
#define _NET_PPP_COMP_H
/*
* The following symbols control whether we include code for
* various compression methods.
*/
#ifndef DO_BSD_COMPRESS
#define DO_BSD_COMPRESS 1 /* by default, include BSD-Compress */
#endif
#ifndef DO_DEFLATE
#define DO_DEFLATE 1 /* by default, include Deflate */
#endif
#define DO_PREDICTOR_1 0
#define DO_PREDICTOR_2 0
/*
* Structure giving methods for compression/decompression.
*/
#ifdef PACKETPTR
struct compressor {
int compress_proto; /* CCP compression protocol number */
/* Allocate space for a compressor (transmit side) */
void *(*comp_alloc) __P((u_char *options, int opt_len));
/* Free space used by a compressor */
void (*comp_free) __P((void *state));
/* Initialize a compressor */
int (*comp_init) __P((void *state, u_char *options, int opt_len,
int unit, int hdrlen, int debug));
/* Reset a compressor */
void (*comp_reset) __P((void *state));
/* Compress a packet */
int (*compress) __P((void *state, PACKETPTR *mret,
PACKETPTR mp, int orig_len, int max_len));
/* Return compression statistics */
void (*comp_stat) __P((void *state, struct compstat *stats));
/* Allocate space for a decompressor (receive side) */
void *(*decomp_alloc) __P((u_char *options, int opt_len));
/* Free space used by a decompressor */
void (*decomp_free) __P((void *state));
/* Initialize a decompressor */
int (*decomp_init) __P((void *state, u_char *options, int opt_len,
int unit, int hdrlen, int mru, int debug));
/* Reset a decompressor */
void (*decomp_reset) __P((void *state));
/* Decompress a packet. */
int (*decompress) __P((void *state, PACKETPTR mp,
PACKETPTR *dmpp));
/* Update state for an incompressible packet received */
void (*incomp) __P((void *state, PACKETPTR mp));
/* Return decompression statistics */
void (*decomp_stat) __P((void *state, struct compstat *stats));
};
#endif /* PACKETPTR */
/*
* Return values for decompress routine.
* We need to make these distinctions so that we can disable certain
* useful functionality, namely sending a CCP reset-request as a result
* of an error detected after decompression. This is to avoid infringing
* a patent held by Motorola.
* Don't you just lurve software patents.
*/
#define DECOMP_OK 0 /* everything went OK */
#define DECOMP_ERROR 1 /* error detected before decomp. */
#define DECOMP_FATALERROR 2 /* error detected after decomp. */
/*
* CCP codes.
*/
#define CCP_CONFREQ 1
#define CCP_CONFACK 2
#define CCP_TERMREQ 5
#define CCP_TERMACK 6
#define CCP_RESETREQ 14
#define CCP_RESETACK 15
/*
* Max # bytes for a CCP option
*/
#define CCP_MAX_OPTION_LENGTH 64
/*
* Parts of a CCP packet.
*/
#define CCP_CODE(dp) ((dp)[0])
#define CCP_ID(dp) ((dp)[1])
#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3])
#define CCP_HDRLEN 4
#define CCP_OPT_CODE(dp) ((dp)[0])
#define CCP_OPT_LENGTH(dp) ((dp)[1])
#define CCP_OPT_MINLEN 2
/*
* Definitions for BSD-Compress.
*/
#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */
#define CILEN_BSD_COMPRESS 3 /* length of config. option */
/* Macros for handling the 3rd byte of the BSD-Compress config option. */
#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */
#define BSD_VERSION(x) ((x) >> 5) /* version of option format */
#define BSD_CURRENT_VERSION 1 /* current version number */
#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n))
#define BSD_MIN_BITS 9 /* smallest code size supported */
#define BSD_MAX_BITS 15 /* largest code size supported */
/*
* Definitions for Deflate.
*/
#define CI_DEFLATE 26 /* config option for Deflate */
#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */
#define CILEN_DEFLATE 4 /* length of its config option */
#define DEFLATE_MIN_SIZE 8
#define DEFLATE_MAX_SIZE 15
#define DEFLATE_METHOD_VAL 8
#define DEFLATE_SIZE(x) (((x) >> 4) + DEFLATE_MIN_SIZE)
#define DEFLATE_METHOD(x) ((x) & 0x0F)
#define DEFLATE_MAKE_OPT(w) ((((w) - DEFLATE_MIN_SIZE) << 4) \
+ DEFLATE_METHOD_VAL)
#define DEFLATE_CHK_SEQUENCE 0
/*
* Definitions for MPPE.
*/
#define CI_MPPE 18 /* config. option for MPPE */
#define CILEN_MPPE 6 /* length of config. option */
/*
* Definitions for Stac LZS.
*/
#define CI_LZS 17 /* config option for Stac LZS */
#define CILEN_LZS 5 /* length of config option */
/*
* Definitions for other, as yet unsupported, compression methods.
*/
#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */
#define CILEN_PREDICTOR_1 2 /* length of its config option */
#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */
#define CILEN_PREDICTOR_2 2 /* length of its config option */
#endif /* _NET_PPP_COMP_H */
|
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software 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.
*
* Cleanflight and Betaflight 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "pg/pg.h"
#ifndef DEFAULT_FEATURES
#define DEFAULT_FEATURES 0
#endif
#ifndef DEFAULT_RX_FEATURE
#define DEFAULT_RX_FEATURE FEATURE_RX_PARALLEL_PWM
#endif
typedef enum {
FEATURE_RX_PPM = 1 << 0,
FEATURE_INFLIGHT_ACC_CAL = 1 << 2,
FEATURE_RX_SERIAL = 1 << 3,
FEATURE_MOTOR_STOP = 1 << 4,
FEATURE_SERVO_TILT = 1 << 5,
FEATURE_SOFTSERIAL = 1 << 6,
FEATURE_GPS = 1 << 7,
FEATURE_RANGEFINDER = 1 << 9,
FEATURE_TELEMETRY = 1 << 10,
FEATURE_3D = 1 << 12,
FEATURE_RX_PARALLEL_PWM = 1 << 13,
FEATURE_RX_MSP = 1 << 14,
FEATURE_RSSI_ADC = 1 << 15,
FEATURE_LED_STRIP = 1 << 16,
FEATURE_DASHBOARD = 1 << 17,
FEATURE_OSD = 1 << 18,
FEATURE_CHANNEL_FORWARDING = 1 << 20,
FEATURE_TRANSPONDER = 1 << 21,
FEATURE_AIRMODE = 1 << 22,
FEATURE_RX_SPI = 1 << 25,
//FEATURE_SOFTSPI = 1 << 26, (removed)
FEATURE_ESC_SENSOR = 1 << 27,
FEATURE_ANTI_GRAVITY = 1 << 28,
FEATURE_DYNAMIC_FILTER = 1 << 29,
} features_e;
typedef struct featureConfig_s {
uint32_t enabledFeatures;
} featureConfig_t;
PG_DECLARE(featureConfig_t, featureConfig);
void featureInit(void);
bool featureIsEnabled(const uint32_t mask);
bool featureIsConfigured(const uint32_t mask);
void featureEnableImmediate(const uint32_t mask);
void featureDisableImmediate(const uint32_t mask);
void featureConfigSet(const uint32_t mask);
void featureConfigClear(const uint32_t mask);
void featureConfigReplace(const uint32_t mask);
|
#include <stdio.h>
#include <stdlib.h>
int fnCheckIdentical(int*, int*, int);
int main()
{
int iaArr1[50],iaArr2[50], iLen1, iLen2, i, iFlag;
int *iptr1, *iptr2;
printf("\nEnter the no of elements in the 1st array\n");
scanf("%d",&iLen1);
printf("\nEnter the no of elements in the 2nd array\n");
scanf("%d",&iLen2);
if(iLen1 != iLen2)
{
printf("\nArrays are not Identical\n");
exit(0);
}
printf("\nEnter elements of 1st Array\n");
for(i = 0; i < iLen1; i++)
scanf("%d",&iaArr1[i]);
printf("\nEnter elements of 2nd Array\n");
for(i = 0; i < iLen2; i++)
scanf("%d",&iaArr2[i]);
iptr1 = iaArr1;
iptr2 = iaArr2;
iFlag = fnCheckIdentical(iptr1, iptr2, iLen1);
if(iFlag)
printf("\nArrays are Identical\n");
else
printf("\nArrays are not Identical\n");
return 0;
}
int fnCheckIdentical(int *p, int *q, int n)
{
int i;
for(i=0; i<n; i++)
{
if(*(p+i) != *(q+i))
return 0;
}
return 1;
}
|
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Gustavo Lopes <[email protected]> |
+----------------------------------------------------------------------+
*/
#ifndef BREAKITERATOR_METHODS_H
#define BREAKITERATOR_METHODS_H
#include <php.h>
PHP_METHOD(BreakIterator, __construct);
PHP_FUNCTION(breakiter_create_word_instance);
PHP_FUNCTION(breakiter_create_line_instance);
PHP_FUNCTION(breakiter_create_character_instance);
PHP_FUNCTION(breakiter_create_sentence_instance);
PHP_FUNCTION(breakiter_create_title_instance);
PHP_FUNCTION(breakiter_create_code_point_instance);
PHP_FUNCTION(breakiter_get_text);
PHP_FUNCTION(breakiter_set_text);
PHP_FUNCTION(breakiter_first);
PHP_FUNCTION(breakiter_last);
PHP_FUNCTION(breakiter_previous);
PHP_FUNCTION(breakiter_next);
PHP_FUNCTION(breakiter_current);
PHP_FUNCTION(breakiter_following);
PHP_FUNCTION(breakiter_preceding);
PHP_FUNCTION(breakiter_is_boundary);
PHP_FUNCTION(breakiter_get_locale);
PHP_FUNCTION(breakiter_get_parts_iterator);
PHP_FUNCTION(breakiter_get_error_code);
PHP_FUNCTION(breakiter_get_error_message);
#endif
|
/* Find a best match between two vectors.
Copyright (C) 2009-2012 Free Software Foundation, Inc.
Written by Andreas Gruenbacher <[email protected]>, 2009.
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/>. */
/* Before including this file, you need to define:
EQUAL_IDX(x, y) A two-argument macro that tests elements
at index x and y for equality.
OFFSET A signed integer type sufficient to hold the
difference between two indices. Usually
something like ssize_t. */
/*
* Shortest Edit Sequence
*
* Based on the Greedy LCS/SES Algorithm (Figure 2) in:
*
* Eugene W. Myers, "An O(ND) Difference Algorithm and Its Variations",
* Algorithmica, Vol. 1, No. 1, pp. 251-266, March 1986.
* Available: http://dx.doi.org/10.1007/BF01840446
* http://xmailserver.org/diff2.pdf
*
* Returns the number of changes (insertions and deletions) required to get
* from a[] to b[]. Returns MAX + 1 if a[] cannot be turned into b[] with
* MAX or fewer changes, in which case *PY is not modified.
*
* MIN specifies the minimum number of elements in which a[] and b[] must
* match. This allows to prevent trivial matches in which a sequence is
* completely discarded, or completely made up.
*
* If PY is not NULL, matches a[] against a prefix of b[], and returns the
* number of elements in b[] that were matched in *PY. Otherwise, matches
* all elements of b[].
*
* Note that the divide-and-conquer strategy discussed in section 4b of the
* paper is more efficient, but does not allow an open-ended prefix string
* search.
*/
static OFFSET
bestmatch(OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim,
OFFSET min, OFFSET max, OFFSET *py)
{
const OFFSET dmin = xoff - ylim; /* Minimum valid diagonal. */
const OFFSET dmax = xlim - yoff; /* Maximum valid diagonal. */
const OFFSET fmid = xoff - yoff; /* Center diagonal. */
OFFSET fmin = fmid;
OFFSET fmax = fmid;
OFFSET *V, *fd;
OFFSET fmid_plus_2_min, ymax = -1;
OFFSET c;
V = malloc ((2 * max + 3) * sizeof (OFFSET));
fd = V + max + 1 - fmid;
/*
The number of elements that were matched in x and in y can be
computed as either (x - x_skipped) or (y - y_skipped), with:
delta = (x - xoff) - (y - yoff)
x_skipped = (c + delta) / 2
y_skipped = (c - delta) / 2
For searching for a minimum number of matching elements, we end up
with this check:
(x - x_skipped) >= min
...
x + y - c >= (xoff - yoff) + 2 * min
x + y - c >= fmid + 2 * min
*/
if (min)
{
fmid_plus_2_min = fmid + 2 * min;
min += yoff;
if (min > ylim)
{
c = max + 1;
goto free_and_return;
}
}
else
fmid_plus_2_min = 0; /* disable this check */
if (!py)
min = ylim;
/* Handle the exact-match case. */
while (xoff < xlim && yoff < ylim && EQUAL_IDX (xoff, yoff))
{
xoff++;
yoff++;
}
if (xoff == xlim && yoff >= min
&& xoff + yoff >= fmid_plus_2_min)
{
ymax = yoff;
c = 0;
}
else
{
fd[fmid] = xoff;
for (c = 1; c <= max; c++)
{
OFFSET d;
if (fmin > dmin)
fd[--fmin - 1] = -1;
else
++fmin;
if (fmax < dmax)
fd[++fmax + 1] = -1;
else
--fmax;
for (d = fmax; d >= fmin; d -= 2)
{
OFFSET x, y;
if (fd[d - 1] < fd[d + 1])
x = fd[d + 1];
else
x = fd[d - 1] + 1;
for (y = x - d;
x < xlim && y < ylim && EQUAL_IDX (x, y);
x++, y++)
/* do nothing */ ;
fd[d] = x;
if (x == xlim && y >= min
&& x + y - c >= fmid_plus_2_min)
{
if (ymax < y)
ymax = y;
if (y == ylim)
goto done;
}
}
if (ymax != -1)
goto done;
}
}
done:
if (py)
*py = ymax;
free_and_return:
free (V);
return c;
}
#undef OFFSET
#undef EQUAL_IDX
|
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
#ifndef CTSAUDIO_SIMPLESCRIPTEXEC_H
#define CTSAUDIO_SIMPLESCRIPTEXEC_H
#include <sys/types.h>
#include <regex.h>
#include <utils/String8.h>
/**
* Utility class for executing simple scripts
* which prints ___CTS_AUDIO_PASS___ string in output
*/
class SimpleScriptExec {
public:
static const char* PYTHON_PATH;
static bool checkPythonEnv();
/**
* run given script
* @param script full path of the script
* @param param arguments to pass
* @param result
*/
static bool runScript(const android::String8& script, const android::String8& param,
android::String8& result);
/**
* check if the given str include magic words for pass.
* @param str
* @param reMatch pattern to match in re besides the pass string
* @param nmatch number of substring pattern match elements. It should be in POSIX
* extended RE syntax, no \d nor [:digit:]
* @param pmatch pattern match elements
* @return true if passed
*/
static bool checkIfPassed(const android::String8& str, const android::String8& reMatch,
int nmatch = 0, regmatch_t pmatch[] = NULL);
};
#endif // CTSAUDIO_SIMPLESCRIPTEXEC_H
|
/* RetroArch - A frontend for libretro.
* Copyright (C) 2014-2017 - Jean-André Santoni
*
* RetroArch 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 Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch 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 RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <time.h>
#include <compat/strl.h>
#include <file/file_path.h>
#include <array/rbuf.h>
#include <string/stdstring.h>
#include <retro_miscellaneous.h>
#include <string.h>
#include <libretro.h>
#include "../wifi_driver.h"
#include "../../retroarch.h"
#include "../../configuration.h"
#include "../../verbosity.h"
typedef struct
{
wifi_network_scan_t scan;
} nmcli_t;
static void *nmcli_init(void)
{
nmcli_t *nmcli = (nmcli_t*)calloc(1, sizeof(nmcli_t));
return nmcli;
}
static void nmcli_free(void *data)
{
nmcli_t *nmcli = (nmcli_t*)data;
if (nmcli)
{
if (nmcli->scan.net_list)
RBUF_FREE(nmcli->scan.net_list);
free(nmcli);
}
}
static bool nmcli_start(void *data)
{
return true;
}
static void nmcli_stop(void *data) { }
static bool nmcli_enable(void* data, bool enabled)
{
/* semantics here are broken: nmcli_enable(..., false) is called
* on startup which is probably not what we want. */
#if 0
if (enabled)
pclose(popen("nmcli radio wifi on", "r"));
else
pclose(popen("nmcli radio wifi off", "r"));
#endif
return true;
}
static bool nmcli_connection_info(void *data, wifi_network_info_t *netinfo)
{
FILE *cmd_file = NULL;
char line[512];
if (!netinfo)
return false;
cmd_file = popen("nmcli -f NAME c show --active | tail -n+2", "r");
if (fgets(line, sizeof(line), cmd_file))
{
strlcpy(netinfo->ssid, line, sizeof(netinfo->ssid));
netinfo->connected = true;
return true;
}
return false;
}
static void nmcli_scan(void *data)
{
char line[512];
nmcli_t *nmcli = (nmcli_t*)data;
FILE *cmd_file = NULL;
nmcli->scan.scan_time = time(NULL);
if (nmcli->scan.net_list)
RBUF_FREE(nmcli->scan.net_list);
cmd_file = popen("nmcli -f IN-USE,SSID dev wifi | tail -n+2", "r");
while (fgets(line, 512, cmd_file))
{
wifi_network_info_t entry;
memset(&entry, 0, sizeof(entry));
string_trim_whitespace(line);
if (strlen(line) < 1)
continue;
if (line[0] == '*')
{
entry.connected = true;
line[0] = ' ';
string_trim_whitespace(line);
}
strlcpy(entry.ssid, line, sizeof(entry.ssid));
RBUF_PUSH(nmcli->scan.net_list, entry);
}
pclose(cmd_file);
}
static wifi_network_scan_t* nmcli_get_ssids(void *data)
{
nmcli_t *nmcli = (nmcli_t*)data;
return &nmcli->scan;
}
static bool nmcli_ssid_is_online(void *data, unsigned idx)
{
nmcli_t *nmcli = (nmcli_t*)data;
if (!nmcli->scan.net_list || idx >= RBUF_LEN(nmcli->scan.net_list))
return false;
return nmcli->scan.net_list[idx].connected;
}
static bool nmcli_connect_ssid(void *data,
const wifi_network_info_t *netinfo)
{
nmcli_t *nmcli = (nmcli_t*)data;
char cmd[256];
int ret, i;
if (!nmcli || !netinfo)
return false;
snprintf(cmd, sizeof(cmd),
"nmcli dev wifi connect \"%s\" password \"%s\" 2>&1",
netinfo->ssid, netinfo->passphrase);
if ((ret = pclose(popen(cmd, "r"))) == 0)
{
for (i = 0; i < RBUF_LEN(nmcli->scan.net_list); i++)
{
wifi_network_info_t* entry = &nmcli->scan.net_list[i];
entry->connected = strcmp(entry->ssid, netinfo->ssid) == 0;
}
}
return true;
}
static bool nmcli_disconnect_ssid(void *data,
const wifi_network_info_t *netinfo)
{
char cmd[256];
snprintf(cmd, sizeof(cmd), "nmcli c down \"%s\"", netinfo->ssid);
pclose(popen(cmd, "r"));
return true;
}
static void nmcli_tether_start_stop(void *a, bool b, char *c) { }
wifi_driver_t wifi_nmcli = {
nmcli_init,
nmcli_free,
nmcli_start,
nmcli_stop,
nmcli_enable,
nmcli_connection_info,
nmcli_scan,
nmcli_get_ssids,
nmcli_ssid_is_online,
nmcli_connect_ssid,
nmcli_disconnect_ssid,
nmcli_tether_start_stop,
"nmcli",
};
|
/*
* Data structure definition for Rockchip IOMMU driver
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __ASM_PLAT_IOMMU_H
#define __ASM_PLAT_IOMMU_H
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/genalloc.h>
#include <linux/iommu.h>
#include <linux/rockchip-iovmm.h>
struct rk_iovmm {
struct iommu_domain *domain; /* iommu domain for this iovmm */
struct gen_pool *vmm_pool;
struct list_head regions_list; /* list of rk_vm_region */
spinlock_t lock; /* lock for updating regions_list */
};
struct iommu_drvdata {
struct list_head node; /* entry of rk_iommu_domain.clients */
struct device *iommu; /* IOMMU's device descriptor */
int num_res_mem;
int num_res_irq;
const char *dbgname;
void __iomem **res_bases;
int activations;
spinlock_t data_lock;
struct iommu_domain *domain; /* domain given to iommu_attach_device() */
unsigned int pgtable;
struct rk_iovmm vmm;
rockchip_iommu_fault_handler_t fault_handler;
};
#ifdef CONFIG_ROCKCHIP_IOVMM
#define IOVA_START 0x10000000
#define IOVM_SIZE (SZ_1G - SZ_4K) /* last 4K is for error values */
struct rk_vm_region {
struct list_head node;
unsigned int start;
unsigned int size;
};
static inline struct rk_iovmm *rockchip_get_iovmm(struct device *dev)
{
struct iommu_drvdata *data = dev_get_drvdata(dev->archdata.iommu);
BUG_ON(!dev->archdata.iommu || !data);
return &data->vmm;
}
int rockchip_init_iovmm(struct device *iommu, struct rk_iovmm *vmm);
#else
static inline int rockchip_init_iovmm(struct device *iommu,
struct rk_iovmm *vmm)
{
return -ENOSYS;
}
#endif
#ifdef CONFIG_ROCKCHIP_IOMMU
/**
* rockchip_iommu_tlb_invalidate() - flush all TLB entry in iommu
* @owner: The device whose IOMMU.
*
* This function flush all TLB entry in iommu
*/
int rockchip_iommu_tlb_invalidate(struct device *owner);
int rockchip_iommu_tlb_invalidate_global(struct device *owner);
#else /* CONFIG_ROCKCHIP_IOMMU */
static inline int rockchip_iommu_tlb_invalidate(struct device *owner)
{
return -1;
}
static int rockchip_iommu_tlb_invalidate_global(struct device *owner)
{
return -1;
}
#endif
#endif /*__ASM_PLAT_IOMMU_H*/
|
#include "scrollable.h"
#include "draw.h"
#include "svg.h"
#include "../macros.h"
#include "../ui.h"
void scroll_draw(SCROLLABLE *s, int x, int y, int width, int height) {
uint32_t c = s->content_height;
uint32_t h = height, m, dy;
uint32_t scroll_width = 0;
if (s->small) {
scroll_width = SCROLL_WIDTH / 2;
} else {
scroll_width = SCROLL_WIDTH;
}
if (h >= c) {
// If h(eight) > c(ontent height), don't draw anything.
return;
} else {
m = (h * h) / c;
double d = (h - m);
dy = (s->d * d) + 0.5;
}
y += dy;
x += s->x;
if (!s->left) {
x += width - scroll_width;
}
drawalpha(s->small ? BM_SCROLLHALFTOP_SMALL : BM_SCROLLHALFTOP, x, y, scroll_width, scroll_width / 2, s->color);
y += scroll_width / 2;
int y2 = y + m - scroll_width;
if (scroll_width > m) {
y2 = y;
}
drawrect(x, y, x + scroll_width, y2, s->color);
drawalpha(s->small ? BM_SCROLLHALFBOT_SMALL : BM_SCROLLHALFBOT, x, y2, scroll_width, scroll_width / 2, s->color);
}
int scroll_gety(SCROLLABLE *s, int height) {
int c = s->content_height;
if (c > height) {
return (s->d * (double)(c - height)) + 0.5;
}
return 0;
}
bool scroll_mmove(SCROLLABLE *s, int UNUSED(px), int UNUSED(py), int width, int height, int x, int y, int UNUSED(dx),
int dy) {
bool draw = false;
bool hit = inrect(x, y, s->left ? 0 : (width - SCROLL_WIDTH), 0, SCROLL_WIDTH, height);
if (s->mouseover != hit) {
s->mouseover = hit;
draw = true;
}
s->mouseover2 = inrect(x, y, 0, 0, width, height);
if (s->mousedown) {
uint32_t c = s->content_height;
uint32_t h = height;
if (c > h) {
uint32_t m = (h * h) / c;
double d = (h - m);
s->d = ((s->d * d) + (double)dy) / d;
if (s->d < 0.0) {
s->d = 0.0;
} else if (s->d >= 1.0) {
s->d = 1.0;
}
draw = true;
}
}
return draw;
}
bool scroll_mdown(SCROLLABLE *s) {
if (s->mouseover) {
s->mousedown = 1;
return true;
}
return false;
}
bool scroll_mright(SCROLLABLE *UNUSED(s)) { return false; }
bool scroll_mwheel(SCROLLABLE *s, int height, double delta, bool smooth) {
/* Variable which controls scroll speed. How much one scroll step
* moves viewport */
double scroll_speed_multip = 5.0;
if (s->mouseover2) {
uint32_t content_height = s->content_height;
uint32_t port_height = height;
if (content_height > port_height) {
/* Scrolling is relative to amount of total content in component */
if (smooth) {
// this seems to be the magic equation that makes it scroll at the same speed
// regardless of how big the port is compared to the content.
s->d -= (delta * (32.0 * port_height / content_height) / content_height) * scroll_speed_multip;
} else {
uint32_t magic = (port_height * port_height) / content_height;
double fred = (port_height - magic);
s->d -= 16.0 * delta / fred;
}
if (s->d < 0.0) {
s->d = 0.0;
} else if (s->d >= 1.0) {
s->d = 1.0;
}
return true;
}
}
return false;
}
bool scroll_mup(SCROLLABLE *s) {
if (s->mousedown) {
s->mousedown = 0;
return true;
}
return false;
}
bool scroll_mleave(SCROLLABLE *s) {
if (s->mouseover) {
s->mouseover = 0;
return true;
}
s->mouseover2 = 0;
return false;
}
|
/* QuesoGLC
* A free implementation of the OpenGL Character Renderer (GLC)
* Copyright (c) 2002, 2004-2007, Bertrand Coconnier
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Id$ */
/** \file
* header of the functions needed for cleanup stack exception handling (CSEH)
*/
#ifndef __glc_except_h
#define __glc_except_h
#include <setjmp.h>
#ifdef __cpluplus
extern "C" {
#endif
typedef unsigned int __glcException;
#define GLC_NO_EXC (__glcException)0
#define GLC_MEMORY_EXC (__glcException)1
jmp_buf* __glcExceptionCreateContext(void);
void __glcExceptionReleaseContext(void);
void __glcExceptionPush(void (*destructor)(void*), void *data);
void __glcExceptionPop(int destroy);
void __glcExceptionUnwind(int destroy);
jmp_buf* __glcExceptionThrow(__glcException exception);
__glcException __glcExceptionCatch(void);
#define TRY \
do { \
jmp_buf* __glcEnv = __glcExceptionCreateContext(); \
if (__glcEnv && (setjmp(*__glcEnv) == 0)) {
#define CATCH(__e__) \
__glcExceptionUnwind(0); \
} \
else { \
__e__ = __glcExceptionCatch();
#define END_CATCH \
} \
__glcExceptionReleaseContext(); \
} while (0);
#define THROW(__e__) \
do { \
jmp_buf* __glcEnv; \
__glcExceptionUnwind(1); \
__glcEnv = __glcExceptionThrow(__e__); \
longjmp(*__glcEnv, 1); \
} while (0);
#define RETHROW(__e__) \
do { \
jmp_buf* __glcEnv; \
__glcExceptionReleaseContext(); \
__glcExceptionUnwind(1); \
__glcEnv = __glcExceptionThrow(__e__); \
longjmp(*__glcEnv, 1); \
} while (0);
#define RETURN(__value__) \
do { \
__glcExceptionUnwind(0); \
__glcExceptionReleaseContext(); \
return __value__; \
} while(0);
#ifdef __cplusplus
}
#endif
#endif
|
/* GStreamer Matroska muxer/demuxer
* (c) 2003 Ronald Bultje <[email protected]>
* (c) 2011 Debarshi Ray <[email protected]>
*
* matroska-demux.h: matroska file/stream demuxer definition
*
* 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; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_MATROSKA_DEMUX_H__
#define __GST_MATROSKA_DEMUX_H__
#include <gst/gst.h>
#include "ebml-read.h"
#include "matroska-ids.h"
#include "matroska-read-common.h"
G_BEGIN_DECLS
#define GST_TYPE_MATROSKA_DEMUX \
(gst_matroska_demux_get_type ())
#define GST_MATROSKA_DEMUX(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemux))
#define GST_MATROSKA_DEMUX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MATROSKA_DEMUX, GstMatroskaDemuxClass))
#define GST_IS_MATROSKA_DEMUX(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MATROSKA_DEMUX))
#define GST_IS_MATROSKA_DEMUX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MATROSKA_DEMUX))
typedef struct _GstMatroskaDemux {
GstElement parent;
/* < private > */
GstMatroskaReadCommon common;
/* pads */
GstClock *clock;
guint num_v_streams;
guint num_a_streams;
guint num_t_streams;
/* state */
gboolean streaming;
guint level_up;
guint64 seek_block;
gboolean seek_first;
/* did we parse cues/tracks/segmentinfo already? */
gboolean tracks_parsed;
GList *seek_parsed;
/* cluster positions (optional) */
GArray *clusters;
/* keeping track of playback position */
gboolean segment_running;
GstClockTime last_stop_end;
GstClockTime stream_start_time;
GstEvent *close_segment;
GstEvent *new_segment;
/* some state saving */
GstClockTime cluster_time;
guint64 cluster_offset;
guint64 first_cluster_offset;
guint64 next_cluster_offset;
/* index stuff */
gboolean seekable;
gboolean building_index;
guint64 index_offset;
GstEvent *seek_event;
gboolean need_newsegment;
/* reverse playback */
GArray *seek_index;
gint seek_entry;
/* gap handling */
guint64 max_gap_time;
/* for non-finalized files, with invalid segment duration */
gboolean invalid_duration;
} GstMatroskaDemux;
typedef struct _GstMatroskaDemuxClass {
GstElementClass parent;
} GstMatroskaDemuxClass;
gboolean gst_matroska_demux_plugin_init (GstPlugin *plugin);
G_END_DECLS
#endif /* __GST_MATROSKA_DEMUX_H__ */
|
/*
* io.c -- dv1394d client demo input/output
* Copyright (C) 2002-2003 Ushodaya Enterprises Limited
* Author: Charles Yates <[email protected]>
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* System header files */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <termios.h>
#include <unistd.h>
/* Application header files */
#include "io.h"
char *chomp( char *input )
{
if ( input != NULL )
{
int length = strlen( input );
if ( length && input[ length - 1 ] == '\n' )
input[ length - 1 ] = '\0';
if ( length > 1 && input[ length - 2 ] == '\r' )
input[ length - 2 ] = '\0';
}
return input;
}
char *trim( char *input )
{
if ( input != NULL )
{
int length = strlen( input );
int first = 0;
while( first < length && isspace( input[ first ] ) )
first ++;
memmove( input, input + first, length - first + 1 );
length = length - first;
while ( length > 0 && isspace( input[ length - 1 ] ) )
input[ -- length ] = '\0';
}
return input;
}
char *strip_quotes( char *input )
{
if ( input != NULL )
{
char *ptr = strrchr( input, '\"' );
if ( ptr != NULL )
*ptr = '\0';
if ( input[ 0 ] == '\"' )
strcpy( input, input + 1 );
}
return input;
}
char *get_string( char *output, int maxlength, char *use )
{
char *value = NULL;
strcpy( output, use );
if ( trim( chomp( fgets( output, maxlength, stdin ) ) ) != NULL )
{
if ( !strcmp( output, "" ) )
strcpy( output, use );
value = output;
}
return value;
}
int *get_int( int *output, int use )
{
int *value = NULL;
char temp[ 132 ];
*output = use;
if ( trim( chomp( fgets( temp, 132, stdin ) ) ) != NULL )
{
if ( strcmp( temp, "" ) )
*output = atoi( temp );
value = output;
}
return value;
}
/** This stores the previous settings
*/
static struct termios oldtty;
static int mode = 0;
/** This is called automatically on application exit to restore the
previous tty settings.
*/
void term_exit(void)
{
if ( mode == 1 )
{
tcsetattr( 0, TCSANOW, &oldtty );
mode = 0;
}
}
/** Init terminal so that we can grab keys without blocking.
*/
void term_init( )
{
struct termios tty;
tcgetattr( 0, &tty );
oldtty = tty;
tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
tty.c_oflag |= OPOST;
tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
tty.c_cflag &= ~(CSIZE|PARENB);
tty.c_cflag |= CS8;
tty.c_cc[ VMIN ] = 1;
tty.c_cc[ VTIME ] = 0;
tcsetattr( 0, TCSANOW, &tty );
mode = 1;
atexit( term_exit );
}
/** Check for a keypress without blocking infinitely.
Returns: ASCII value of keypress or -1 if no keypress detected.
*/
int term_read( )
{
int n = 1;
unsigned char ch;
struct timeval tv;
fd_set rfds;
FD_ZERO( &rfds );
FD_SET( 0, &rfds );
tv.tv_sec = 0;
tv.tv_usec = 250;
n = select( 1, &rfds, NULL, NULL, &tv );
if (n > 0)
{
n = read( 0, &ch, 1 );
tcflush( 0, TCIFLUSH );
if (n == 1)
return ch;
return n;
}
return -1;
}
char get_keypress( )
{
char value = '\0';
int pressed = 0;
fflush( stdout );
term_init( );
while ( ( pressed = term_read( ) ) == -1 ) ;
term_exit( );
value = (char)pressed;
return value;
}
void wait_for_any_key( char *message )
{
if ( message == NULL )
printf( "Press any key to continue: " );
else
printf( "%s", message );
get_keypress( );
printf( "\n\n" );
}
void beep( )
{
printf( "%c", 7 );
fflush( stdout );
}
|
/****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* All contents are licensed under LGPL V2.1 */
/* See LICENSE for full restrictions */
/****************************************************************/
#ifndef STRESSDIVERGENCERSPHERICAL_H
#define STRESSDIVERGENCERSPHERICAL_H
#include "Kernel.h"
//Forward Declarations
class SymmElasticityTensor;
class SymmTensor;
class StressDivergenceRSpherical : public Kernel
{
public:
StressDivergenceRSpherical(const std::string & name, InputParameters parameters);
virtual ~StressDivergenceRSpherical() {}
protected:
virtual Real computeQpResidual();
virtual Real computeQpJacobian();
virtual Real computeQpOffDiagJacobian(unsigned int jvar);
MaterialProperty<SymmTensor> & _stress;
MaterialProperty<SymmElasticityTensor> & _Jacobian_mult;
MaterialProperty<SymmTensor> & _d_stress_dT;
private:
const unsigned int _component;
const bool _temp_coupled;
const unsigned int _temp_var;
};
template<>
InputParameters validParams<StressDivergenceRSpherical>();
#endif //STRESSDIVERGENCERSPHERICAL_H
|
/*
StateController.h - Abstract state controller for OpenTempescope
Released as part of the OpenTempescope project - http://tempescope.com/opentempescope/
Copyright (c) 2013 Ken Kawamoto. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef StateController_h
#define StateController_h
#include <Arduino.h>
#define NO_ACTION -1
class StateController{
public:
StateController();
void doAction(int action);
int state();
protected:
void setState(int state);
void setStateTTL(long ttl);
void setTimerToZero();
/**
Called by setState when state has been changed
**/
virtual void stateChangedTo(int state){};
virtual void transition(int state,int action){};
virtual void stateTimedOut(int state){};
private:
int currentState;
long inStateSince;
long stateTTL;
};
#endif
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation ([email protected])
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at [email protected].
**
**************************************************************************/
#ifndef ANNOTATIONHIGHLIGHTER_H
#define ANNOTATIONHIGHLIGHTER_H
#include <vcsbase/baseannotationhighlighter.h>
namespace Git {
namespace Internal {
// Annotation highlighter for p4 triggering on 'changenumber:'
class GitAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
{
Q_OBJECT
public:
explicit GitAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
QTextDocument *document = 0);
private:
virtual QString changeNumber(const QString &block) const;
const QChar m_blank;
};
} // namespace Internal
} // namespace Git
#endif // ANNOTATIONHIGHLIGHTER_H
|
// -*- Mode:C++ -*-
/************************************************************************\
* *
* This file is part of AVANGO. *
* *
* Copyright 2007 - 2010 Fraunhofer-Gesellschaft zur Foerderung der *
* angewandten Forschung (FhG), Munich, Germany. *
* *
* AVANGO 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, version 3. *
* *
* AVANGO 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 Lesser General Public *
* License along with AVANGO. If not, see <http://www.gnu.org/licenses/>. *
* *
\************************************************************************/
#ifndef example_H
#define example_H example_H
#include <shade/GLSLTexture.h>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <string>
namespace example
{
void init(int argc, char* argv[], std::string name, int width = 640, int height = 480);
void setup_camera(void);
void draw_default_scene(bool clear = true);
void set_display_func(boost::function<void (void)> func);
void set_distance(double dist);
void set_still_camera(void);
void run_main_loop(void);
boost::shared_ptr<shade::GLSLTexture> make_texture(const std::string& fname);
}
#endif
|
/* Copyright 2015 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LIB_STRINGS_NUMBERS_H_
#define TENSORFLOW_LIB_STRINGS_NUMBERS_H_
#include <string>
#include "tensorflow/core/platform/port.h"
namespace tensorflow {
namespace strings {
// ----------------------------------------------------------------------
// FastIntToBufferLeft()
// These are intended for speed.
//
// All functions take the output buffer as an arg. FastInt() uses
// at most 22 bytes, FastTime() uses exactly 30 bytes. They all
// return a pointer to the beginning of the output, which is the same as
// the beginning of the input buffer.
//
// NOTE: In 64-bit land, sizeof(time_t) is 8, so it is possible
// to pass to FastTimeToBuffer() a time whose year cannot be
// represented in 4 digits. In this case, the output buffer
// will contain the string "Invalid:<value>"
// ----------------------------------------------------------------------
// Previously documented minimums -- the buffers provided must be at least this
// long, though these numbers are subject to change:
// Int32, UInt32: 12 bytes
// Int64, UInt64, Int, Uint: 22 bytes
// Time: 30 bytes
// Use kFastToBufferSize rather than hardcoding constants.
static const int kFastToBufferSize = 32;
// ----------------------------------------------------------------------
// FastInt32ToBufferLeft()
// FastUInt32ToBufferLeft()
// FastInt64ToBufferLeft()
// FastUInt64ToBufferLeft()
//
// These functions convert their numeric argument to an ASCII
// representation of the numeric value in base 10, with the
// representation being left-aligned in the buffer. The caller is
// responsible for ensuring that the buffer has enough space to hold
// the output. The buffer should typically be at least kFastToBufferSize
// bytes.
//
// Returns a pointer to the end of the string (i.e. the null character
// terminating the string).
// ----------------------------------------------------------------------
char* FastInt32ToBufferLeft(int32 i, char* buffer); // at least 12 bytes
char* FastUInt32ToBufferLeft(uint32 i, char* buffer); // at least 12 bytes
char* FastInt64ToBufferLeft(int64 i, char* buffer); // at least 22 bytes
char* FastUInt64ToBufferLeft(uint64 i, char* buffer); // at least 22 bytes
// Required buffer size for DoubleToBuffer is kFastToBufferSize.
// Required buffer size for FloatToBuffer is kFastToBufferSize.
char* DoubleToBuffer(double i, char* buffer);
char* FloatToBuffer(float i, char* buffer);
// Convert a 64-bit fingerprint value to an ASCII representation.
string FpToString(Fprint fp);
// Attempt to parse a fingerprint in the form encoded by FpToString. If
// successsful, stores the fingerprint in *fp and returns true. Otherwise,
// returns false.
bool StringToFp(const string& s, Fprint* fp);
// Convert strings to 32bit integer values.
// Leading and trailing spaces are allowed.
// Return false with overflow or invalid input.
bool safe_strto32(const char* str, int32* value);
// Convert strings to 64bit integer values.
// Leading and trailing spaces are allowed.
// Return false with overflow or invalid input.
bool safe_strto64(const char* str, int64* value);
// Convert strings to floating point values.
// Leading and trailing spaces are allowed.
// Values may be rounded on over- and underflow.
bool safe_strtof(const char* str, float* value);
// Converts from an int64 representing a number of bytes to a
// human readable string representing the same number.
// e.g. 12345678 -> "11.77MiB".
string HumanReadableNumBytes(int64 num_bytes);
} // namespace strings
} // namespace tensorflow
#endif // TENSORFLOW_LIB_STRINGS_NUMBERS_H_
|
// -------------------------------------------------------------------------
// @FileName £º NFIGameServerScriptModule.h
// @Author £º LvSheng.Huang
// @Date £º 2013-07-08
// @Module £º NFIGameServerScriptModule
//
// -------------------------------------------------------------------------
#ifndef _NFI_GAMESERVERSCRIPT_MODULE_H_
#define _NFI_GAMESERVERSCRIPT_MODULE_H_
#include <iostream>
#include "NFILogicModule.h"
class NFIGameServerScriptModule
: public NFILogicModule
{
public:
};
#endif
|
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
// Implement a simple JSON representation format for arrays
#ifndef ARROW_IPC_JSON_SIMPLE_H
#define ARROW_IPC_JSON_SIMPLE_H
#include <memory>
#include <string>
#include "arrow/status.h"
#include "arrow/util/string_view.h"
#include "arrow/util/visibility.h"
namespace arrow {
class Array;
class DataType;
namespace ipc {
namespace internal {
namespace json {
ARROW_EXPORT
Status ArrayFromJSON(const std::shared_ptr<DataType>&, const std::string& json,
std::shared_ptr<Array>* out);
ARROW_EXPORT
Status ArrayFromJSON(const std::shared_ptr<DataType>&, const util::string_view& json,
std::shared_ptr<Array>* out);
ARROW_EXPORT
Status ArrayFromJSON(const std::shared_ptr<DataType>&, const char* json,
std::shared_ptr<Array>* out);
} // namespace json
} // namespace internal
} // namespace ipc
} // namespace arrow
#endif // ARROW_IPC_JSON_SIMPLE_H
|
/*
Copyright 2010 Etay Meiri
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 PIPELINE_H
#define PIPELINE_H
#include "ogldev_math_3d.h"
#include "ogldev_camera.h"
struct Orientation
{
Vector3f m_scale;
Vector3f m_rotation;
Vector3f m_pos;
Orientation()
{
m_scale = Vector3f(1.0f, 1.0f, 1.0f);
m_rotation = Vector3f(0.0f, 0.0f, 0.0f);
m_pos = Vector3f(0.0f, 0.0f, 0.0f);
}
};
class Pipeline
{
public:
Pipeline()
{
m_scale = Vector3f(1.0f, 1.0f, 1.0f);
m_worldPos = Vector3f(0.0f, 0.0f, 0.0f);
m_rotateInfo = Vector3f(0.0f, 0.0f, 0.0f);
}
void Scale(float s)
{
Scale(s, s, s);
}
void Scale(const Vector3f& scale)
{
Scale(scale.x, scale.y, scale.z);
}
void Scale(float ScaleX, float ScaleY, float ScaleZ)
{
m_scale.x = ScaleX;
m_scale.y = ScaleY;
m_scale.z = ScaleZ;
}
void WorldPos(float x, float y, float z)
{
m_worldPos.x = x;
m_worldPos.y = y;
m_worldPos.z = z;
}
void WorldPos(const Vector3f& Pos)
{
m_worldPos = Pos;
}
void Rotate(float RotateX, float RotateY, float RotateZ)
{
m_rotateInfo.x = RotateX;
m_rotateInfo.y = RotateY;
m_rotateInfo.z = RotateZ;
}
void Rotate(const Vector3f& r)
{
Rotate(r.x, r.y, r.z);
}
void SetPerspectiveProj(const PersProjInfo& p)
{
m_persProjInfo = p;
}
void SetOrthographicProj(const OrthoProjInfo& p)
{
m_orthoProjInfo = p;
}
void SetCamera(const Vector3f& Pos, const Vector3f& Target, const Vector3f& Up)
{
m_camera.Pos = Pos;
m_camera.Target = Target;
m_camera.Up = Up;
}
void SetCamera(const Camera& camera)
{
SetCamera(camera.GetPos(), camera.GetTarget(), camera.GetUp());
}
void Orient(const Orientation& o)
{
m_scale = o.m_scale;
m_worldPos = o.m_pos;
m_rotateInfo = o.m_rotation;
}
const Matrix4f& GetWPTrans();
const Matrix4f& GetWVTrans();
const Matrix4f& GetVPTrans();
const Matrix4f& GetWVPTrans();
const Matrix4f& GetWVOrthoPTrans();
const Matrix4f& GetWorldTrans();
const Matrix4f& GetViewTrans();
const Matrix4f& GetProjTrans();
private:
Vector3f m_scale;
Vector3f m_worldPos;
Vector3f m_rotateInfo;
PersProjInfo m_persProjInfo;
OrthoProjInfo m_orthoProjInfo;
struct {
Vector3f Pos;
Vector3f Target;
Vector3f Up;
} m_camera;
Matrix4f m_WVPtransformation;
Matrix4f m_VPtransformation;
Matrix4f m_WPtransformation;
Matrix4f m_WVtransformation;
Matrix4f m_Wtransformation;
Matrix4f m_Vtransformation;
Matrix4f m_ProjTransformation;
};
#endif /* PIPELINE_H */
|
#pragma once
#include <cstdint>
#include <forward_list>
#include <string>
#include <vector>
#include "common/common/logger.h"
#include "extensions/filters/network/common/redis/codec.h"
namespace Envoy {
namespace Extensions {
namespace NetworkFilters {
namespace Common {
namespace Redis {
/**
* Decoder implementation of https://redis.io/topics/protocol
*
* This implementation buffers when needed and will always consume all bytes passed for decoding.
*/
class DecoderImpl : public Decoder, Logger::Loggable<Logger::Id::redis> {
public:
DecoderImpl(DecoderCallbacks& callbacks) : callbacks_(callbacks) {}
// RedisProxy::Decoder
void decode(Buffer::Instance& data) override;
private:
enum class State {
ValueRootStart,
ValueStart,
IntegerStart,
Integer,
IntegerLF,
BulkStringBody,
CR,
LF,
SimpleString,
ValueComplete
};
struct PendingInteger {
void reset() {
integer_ = 0;
negative_ = false;
}
uint64_t integer_;
bool negative_;
};
struct PendingValue {
RespValue* value_;
uint64_t current_array_element_;
};
void parseSlice(const Buffer::RawSlice& slice);
DecoderCallbacks& callbacks_;
State state_{State::ValueRootStart};
PendingInteger pending_integer_;
RespValuePtr pending_value_root_;
std::forward_list<PendingValue> pending_value_stack_;
};
/**
* A factory implementation that returns a real decoder.
*/
class DecoderFactoryImpl : public DecoderFactory {
public:
// RedisProxy::DecoderFactory
DecoderPtr create(DecoderCallbacks& callbacks) override {
return DecoderPtr{new DecoderImpl(callbacks)};
}
};
/**
* Encoder implementation of https://redis.io/topics/protocol
*/
class EncoderImpl : public Encoder {
public:
// RedisProxy::Encoder
void encode(const RespValue& value, Buffer::Instance& out) override;
private:
void encodeArray(const std::vector<RespValue>& array, Buffer::Instance& out);
void encodeCompositeArray(const RespValue::CompositeArray& array, Buffer::Instance& out);
void encodeBulkString(const std::string& string, Buffer::Instance& out);
void encodeError(const std::string& string, Buffer::Instance& out);
void encodeInteger(int64_t integer, Buffer::Instance& out);
void encodeSimpleString(const std::string& string, Buffer::Instance& out);
};
} // namespace Redis
} // namespace Common
} // namespace NetworkFilters
} // namespace Extensions
} // namespace Envoy
|
/*
* Copyright 2016 The Cartographer Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef CARTOGRAPHER_SENSOR_INTERNAL_COLLATOR_H_
#define CARTOGRAPHER_SENSOR_INTERNAL_COLLATOR_H_
#include <functional>
#include <memory>
#include <vector>
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "cartographer/sensor/collator_interface.h"
#include "cartographer/sensor/data.h"
#include "cartographer/sensor/internal/ordered_multi_queue.h"
namespace cartographer {
namespace sensor {
class Collator : public CollatorInterface {
public:
Collator() {}
Collator(const Collator&) = delete;
Collator& operator=(const Collator&) = delete;
void AddTrajectory(
int trajectory_id,
const absl::flat_hash_set<std::string>& expected_sensor_ids,
const Callback& callback) override;
void FinishTrajectory(int trajectory_id) override;
void AddSensorData(int trajectory_id, std::unique_ptr<Data> data) override;
void Flush() override;
absl::optional<int> GetBlockingTrajectoryId() const override;
private:
// Queue keys are a pair of trajectory ID and sensor identifier.
OrderedMultiQueue queue_;
// Map of trajectory ID to all associated QueueKeys.
absl::flat_hash_map<int, std::vector<QueueKey>> queue_keys_;
};
} // namespace sensor
} // namespace cartographer
#endif // CARTOGRAPHER_SENSOR_INTERNAL_COLLATOR_H_
|
/*
* Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#import "../AmazonServiceRequestConfig.h"
/**
* Create Key Pair Request
*/
@interface EC2CreateKeyPairRequest:AmazonServiceRequestConfig
{
NSString *keyName;
}
/**
* The unique name for the new key pair.
*/
@property (nonatomic, retain) NSString *keyName;
/**
* Default constructor for a new CreateKeyPairRequest object. Callers should use the
* property methods to initialize this object after creating it.
*/
-(id)init;
/**
* Constructs a new CreateKeyPairRequest object.
* Callers should use properties to initialize any additional object members.
*
* @param theKeyName The unique name for the new key pair.
*/
-(id)initWithKeyName:(NSString *)theKeyName;
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*/
-(NSString *)description;
@end
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_
#define CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "content/public/common/page_type.h"
#include "ui/gfx/native_widget_types.h"
#include "url/gurl.h"
namespace base {
class FilePath;
}
namespace gfx {
class Point;
class Range;
class Rect;
}
// A collections of functions designed for use with content_shell based browser
// tests.
// Note: if a function here also works with browser_tests, it should be in
// content\public\test\browser_test_utils.h
namespace content {
class MessageLoopRunner;
class RenderFrameHost;
class RenderWidgetHost;
class Shell;
// Generate the file path for testing a particular test.
// The file for the tests is all located in
// content/test/data/dir/<file>
// The returned path is FilePath format.
//
// A null |dir| indicates the root directory - i.e.
// content/test/data/<file>
base::FilePath GetTestFilePath(const char* dir, const char* file);
// Generate the URL for testing a particular test.
// HTML for the tests is all located in
// test_root_directory/dir/<file>
// The returned path is GURL format.
//
// A null |dir| indicates the root directory - i.e.
// content/test/data/<file>
GURL GetTestUrl(const char* dir, const char* file);
// Navigates |window| to |url|, blocking until the navigation finishes.
// Returns true if the page was loaded successfully and the last committed
// URL matches |url|.
// TODO(alexmos): any tests that use this function and expect successful
// navigations should do EXPECT_TRUE(NavigateToURL()).
bool NavigateToURL(Shell* window, const GURL& url);
void LoadDataWithBaseURL(Shell* window,
const GURL& url,
const std::string& data,
const GURL& base_url);
// Navigates |window| to |url|, blocking until the given number of navigations
// finishes.
void NavigateToURLBlockUntilNavigationsComplete(Shell* window,
const GURL& url,
int number_of_navigations);
// Navigates |window| to |url|, blocks until the navigation finishes, and
// checks that the navigation did not commit (e.g., due to a crash or
// download).
bool NavigateToURLAndExpectNoCommit(Shell* window, const GURL& url);
// Reloads |window|, blocking until the given number of navigations finishes.
void ReloadBlockUntilNavigationsComplete(Shell* window,
int number_of_navigations);
// Reloads |window| with bypassing cache flag, and blocks until the given number
// of navigations finishes.
void ReloadBypassingCacheBlockUntilNavigationsComplete(
Shell* window,
int number_of_navigations);
// Wait until an application modal dialog is requested.
void WaitForAppModalDialog(Shell* window);
// Extends the ToRenderFrameHost mechanism to content::Shells.
RenderFrameHost* ConvertToRenderFrameHost(Shell* shell);
// Used to wait for a new Shell window to be created. Instantiate this object
// before the operation that will create the window.
class ShellAddedObserver {
public:
ShellAddedObserver();
~ShellAddedObserver();
// Will run a message loop to wait for the new window if it hasn't been
// created since the constructor.
Shell* GetShell();
private:
void ShellCreated(Shell* shell);
Shell* shell_;
scoped_refptr<MessageLoopRunner> runner_;
DISALLOW_COPY_AND_ASSIGN(ShellAddedObserver);
};
#if defined OS_MACOSX
void SetWindowBounds(gfx::NativeWindow window, const gfx::Rect& bounds);
// This method will request the string (word) at |point| inside the |rwh| where
// |point| is with respect to the |rwh| coordinates. |result_callback| is called
// with the word as well as |baselinePoint| when the result comes back from the
// renderer. The baseline point is the position of the pop-up in AppKit
// coordinate system (inverted y-axis).
void GetStringAtPointForRenderWidget(
RenderWidgetHost* rwh,
const gfx::Point& point,
base::Callback<void(const std::string&, const gfx::Point&)>
result_callback);
// This method will request the string identified by |range| inside the |rwh|.
// When the result comes back, |result_callback| is invoked with the given text
// and its position in AppKit coordinates (inverted-y axis).
void GetStringFromRangeForRenderWidget(
RenderWidgetHost* rwh,
const gfx::Range& range,
base::Callback<void(const std::string&, const gfx::Point&)>
result_callback);
#endif
} // namespace content
#endif // CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_
|
#ifndef _IPU_MACROBLOCKTYPEPTABLE_H_
#define _IPU_MACROBLOCKTYPEPTABLE_H_
#include "mpeg2/VLCTable.h"
namespace IPU
{
class CMacroblockTypePTable : public MPEG2::CVLCTable
{
public:
CMacroblockTypePTable();
static MPEG2::CVLCTable* GetInstance();
enum MAXBITS
{
MAXBITS = 6,
};
enum ENTRYCOUNT
{
ENTRYCOUNT = 7,
};
private:
static MPEG2::VLCTABLEENTRY m_pTable[ENTRYCOUNT];
static unsigned int m_pIndexTable[MAXBITS];
static MPEG2::CVLCTable* m_pInstance;
};
}
#endif
|
/*
* puts.c - print a string onto the standard output stream
*/
/* $Header$ */
#include <stdio.h>
int
puts(register const char *s)
{
register FILE *file = stdout;
register int i = 0;
while (*s) {
if (putc(*s++, file) == EOF) return EOF;
else i++;
}
if (putc('\n', file) == EOF) return EOF;
return i + 1;
}
|
//
// APCUserInfoViewController.h
// APCAppCore
//
// Copyright (c) 2015, Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation and/or
// other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder(s) nor the names of any contributors
// may be used to endorse or promote products derived from this software without
// specific prior written permission. No license is granted to the trademarks of
// the copyright holders even if such marks are included in this software.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#import <UIKit/UIKit.h>
#import "APCTextFieldTableViewCell.h"
#import "APCPickerTableViewCell.h"
#import "APCSegmentedTableViewCell.h"
#import "APCDefaultTableViewCell.h"
#import "APCSwitchTableViewCell.h"
#import "APCUser+UserData.h"
#import "APCTableViewItem.h"
@interface APCUserInfoViewController : UITableViewController <APCTextFieldTableViewCellDelegate, APCSegmentedTableViewCellDelegate, APCPickerTableViewCellDelegate, APCSwitchTableViewCellDelegate, UITextFieldDelegate>
/*
Items is an Array of APCTableViewSection
*/
@property (nonatomic, strong) NSArray *items;
@property (nonatomic, getter=isPickerShowing) BOOL pickerShowing;
@property (nonatomic, strong) NSIndexPath *pickerIndexPath;
@property (nonatomic, getter=isEditing, setter=setEditing:) BOOL editing;
@property (nonatomic, getter=isSignup) BOOL signUp;
- (void)setupDefaultCellAppearance:(APCDefaultTableViewCell *)cell;
- (void)setupPickerCellAppeareance:(APCPickerTableViewCell *)cell;
- (void)setupTextFieldCellAppearance:(APCTextFieldTableViewCell *)cell;
- (void)setupSegmentedCellAppearance:(APCSegmentedTableViewCell *)cell;
- (void)setupSwitchCellAppearance:(APCSwitchTableViewCell *)cell;
- (void)setupBasicCellAppearance:(UITableViewCell *)cell;
- (void)nextResponderForIndexPath:(NSIndexPath *)indexPath;
- (void)showPickerAtIndex:(NSIndexPath *)indexPath;
- (void)hidePickerCell;
- (APCTableViewItem *)itemForIndexPath:(NSIndexPath *)indexPath;
- (APCTableViewItemType)itemTypeForIndexPath:(NSIndexPath *)indexPath;
@end
|
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SERVICES_NETWORK_PUBLIC_CPP_PRIVATE_NETWORK_ACCESS_CHECK_RESULT_H_
#define SERVICES_NETWORK_PUBLIC_CPP_PRIVATE_NETWORK_ACCESS_CHECK_RESULT_H_
#include "base/component_export.h"
#include "base/strings/string_piece_forward.h"
#include "services/network/public/mojom/cors.mojom-forward.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
namespace network {
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class PrivateNetworkAccessCheckResult {
// Request is allowed because it is missing a client security state.
kAllowedMissingClientSecurityState = 0,
// Not a private network request: the resource address space is no less
// public than the client's.
kAllowedNoLessPublic = 1,
// Private network request: allowed because policy is `kAllow`.
kAllowedByPolicyAllow = 2,
// Private network request: allowed because policy is `kWarn`.
kAllowedByPolicyWarn = 3,
// URL loader options include `kURLLoadOptionBlockLocalRequest` and the
// resource address space is not `kPublic`.
kBlockedByLoadOption = 4,
// Private network request: blocked because policy is `kBlock`.
kBlockedByPolicyBlock = 5,
// Request carries a `target_ip_address_space` that matches the resource
// address space.
kAllowedByTargetIpAddressSpace = 6,
// Request carries a `target_ip_address_space` that differs from the actual
// resource address space. This may be indicative of a DNS rebinding attack.
kBlockedByTargetIpAddressSpace = 7,
// Private network request: blocked because `target_ip_address_space` is
// `kUnknown` and policy is `kPreflightWarn`.
kBlockedByPolicyPreflightWarn = 8,
// Private network request: blocked because `target_ip_address_space` is
// `kUnknown` and policy is `kPreflightBlock`.
kBlockedByPolicyPreflightBlock = 9,
// Required for UMA histogram logging.
kMaxValue = kBlockedByPolicyPreflightBlock,
};
// Returns a human-readable string representing `result`, suitable for logging.
base::StringPiece COMPONENT_EXPORT(NETWORK_CPP)
PrivateNetworkAccessCheckResultToStringPiece(
PrivateNetworkAccessCheckResult result);
// If `result` indicates that the request should be blocked, returns the
// corresponding `CorsError` enum value. Otherwise returns `nullopt`.
absl::optional<mojom::CorsError> COMPONENT_EXPORT(NETWORK_CPP)
PrivateNetworkAccessCheckResultToCorsError(
PrivateNetworkAccessCheckResult result);
} // namespace network
#endif // SERVICES_NETWORK_PUBLIC_CPP_PRIVATE_NETWORK_ACCESS_CHECK_RESULT_H_
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.