text
stringlengths
4
6.14k
/*************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (directui@nokia.com) ** ** This file is part of libmeegotouch. ** ** If you have questions regarding the use of this file, please contact ** Nokia at directui@nokia.com. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation ** and appearing in the file LICENSE.LGPL included in the packaging ** of this file. ** ****************************************************************************/ #ifndef MLISTITEMANIMATIONSTYLE_H #define MLISTITEMANIMATIONSTYLE_H #include <manimationstyle.h> #include <QEasingCurve> //! \internal class MBasicListItemDeletionAnimationStyle : public MAnimationStyle { Q_OBJECT M_STYLE(MBasicListItemDeletionAnimationStyle) M_STYLE_ATTRIBUTE(int, deleteDelay, DeleteDelay) M_STYLE_ATTRIBUTE(int, deleteDuration, DeleteDuration) M_STYLE_ATTRIBUTE(qreal, deleteOpacity, DeleteOpacity) M_STYLE_ATTRIBUTE(qreal, deleteScale, DeleteScale) M_STYLE_ATTRIBUTE(QEasingCurve, deleteCurve, DeleteCurve) M_STYLE_ATTRIBUTE(int, moveDelay, MoveDelay) M_STYLE_ATTRIBUTE(int, moveDuration, MoveDuration) M_STYLE_ATTRIBUTE(QEasingCurve, moveCurve, MoveCurve) }; class MBasicListItemDeletionAnimationStyleContainer : public MAnimationStyleContainer { M_STYLE_CONTAINER(MBasicListItemDeletionAnimationStyle) }; //! \internal_end #endif
/* * Copyright (c) 2014 Red Hat, Inc. * * 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 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ #include "general.h" #include "gtkprivate.h" #ifdef GDK_WINDOWING_X11 #include "x11/gdkx.h" #endif #ifdef GDK_WINDOWING_WIN32 #include "win32/gdkwin32.h" #endif #ifdef GDK_WINDOWING_QUARTZ #include "quartz/gdkquartz.h" #endif #ifdef GDK_WINDOWING_WAYLAND #include "wayland/gdkwayland.h" #endif #ifdef GDK_WINDOWING_BROADWAY #include "broadway/gdkbroadway.h" #endif struct _GtkInspectorGeneralPrivate { GtkWidget *gtk_version; GtkWidget *gdk_backend; GtkWidget *prefix; GtkWidget *xdg_data_home; GtkWidget *xdg_data_dirs; GtkWidget *gtk_path; GtkWidget *gtk_exe_prefix; GtkWidget *gtk_data_prefix; }; G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorGeneral, gtk_inspector_general, GTK_TYPE_BOX) static void init_version (GtkInspectorGeneral *gen) { const gchar *backend; GdkDisplay *display; display = gtk_widget_get_display (GTK_WIDGET (gen)); #ifdef GDK_WINDOWING_X11 if (GDK_IS_X11_DISPLAY (display)) backend = "X11"; else #endif #ifdef GDK_WINDOWING_WAYLAND if (GDK_IS_WAYLAND_DISPLAY (display)) backend = "Wayland"; else #endif #ifdef GDK_WINDOWING_BROADWAY if (GDK_IS_BROADWAY_DISPLAY (display)) backend = "Broadway"; else #endif #ifdef GDK_WINDOWING_WIN32 if (GDK_IS_WIN32_DISPLAY (display)) backend = "Windows"; else #endif #ifdef GDK_WINDOWING_QUARTZ if (GDK_IS_QUARTZ_DISPLAY (display)) backend = "Quartz"; else #endif backend = "Unknown"; gtk_label_set_text (GTK_LABEL (gen->priv->gtk_version), GTK_VERSION); gtk_label_set_text (GTK_LABEL (gen->priv->gdk_backend), backend); } static void set_monospace_font (GtkWidget *w) { PangoFontDescription *font_desc; font_desc = pango_font_description_from_string ("monospace"); gtk_widget_override_font (w, font_desc); pango_font_description_free (font_desc); } static void set_path_label (GtkWidget *w, const gchar *var) { const gchar *v; v = g_getenv (var); if (v != NULL) { set_monospace_font (w); gtk_label_set_text (GTK_LABEL (w), v); } else { GtkWidget *r; r = gtk_widget_get_ancestor (w, GTK_TYPE_LIST_BOX_ROW); gtk_widget_hide (r); } } static void init_env (GtkInspectorGeneral *gen) { set_monospace_font (gen->priv->prefix); gtk_label_set_text (GTK_LABEL (gen->priv->prefix), _gtk_get_data_prefix ()); set_path_label (gen->priv->xdg_data_home, "XDG_DATA_HOME"); set_path_label (gen->priv->xdg_data_dirs, "XDG_DATA_DIRS"); set_path_label (gen->priv->gtk_path, "GTK_PATH"); set_path_label (gen->priv->gtk_exe_prefix, "GTK_EXE_PREFIX"); set_path_label (gen->priv->gtk_data_prefix, "GTK_DATA_PREFIX"); } static void gtk_inspector_general_init (GtkInspectorGeneral *gen) { gen->priv = gtk_inspector_general_get_instance_private (gen); gtk_widget_init_template (GTK_WIDGET (gen)); init_version (gen); init_env (gen); } static void gtk_inspector_general_class_init (GtkInspectorGeneralClass *klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/general.ui"); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gtk_version); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gdk_backend); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, prefix); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, xdg_data_home); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, xdg_data_dirs); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gtk_path); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gtk_exe_prefix); gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorGeneral, gtk_data_prefix); } // vim: set et sw=2 ts=2:
/* Copyright (c) 2004-2008, Jeremy Cole and others 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 */ #ifndef WKB_PRIV_H #define WKB_PRIV_H #include "mygis_priv.h" #include "wkb.h" #include "geometry_priv.h" #include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> #define WKB_SZ_BYTEORDER 1 #define WKB_SZ_TYPE 4 #define WKB_SZ_NUMITEMS 4 #define WKB_SZ_POINT (SZ_DOUBLE*2) #define WKB_F_DUPE 0x0001 #define WKB_UNKNOWN 0 #define WKB_POINT 1 #define WKB_LINESTRING 2 #define WKB_POLYGON 3 #define WKB_MULTIPOINT 4 #define WKB_MULTILINESTRING 5 #define WKB_MULTIPOLYGON 6 #define WKB_GEOMETRYCOLLECTION 7 #define WKB_BYTEORDER(pos) MYGIS_READ_BYTE_LE(pos) #define WKB_TYPE(pos) MYGIS_READ_UINT32_LE(pos+1) #define WKB_NUMITEMS(pos) MYGIS_READ_UINT32_LE(pos+5) #define WKB_DATA(pos) (pos+(WKB_TYPE(pos)==WKB_POINT?5:9)) #define WKB_X(pos) (pos) #define WKB_Y(pos) (pos+SZ_DOUBLE) #define WKB_INIT MYGIS_MALLOC(WKB) #define WKB_TYPE_MAX 8 extern const char WKB_TYPES[8][20]; POINT *_wkb_read_points(char *pos, uint32 num, char **next); LINEARRING *_wkb_read_linearrings(char *pos, uint32 num, char **next); /* Simple Types, capable of reading multiples */ GEOMETRY_POINT *_wkb_read_geometry_points(WKB *wkb, uint32 num); GEOMETRY_LINESTRING *_wkb_read_geometry_linestrings(WKB *wkb, uint32 num); GEOMETRY_POLYGON *_wkb_read_geometry_polygons(WKB *wkb, uint32 num); /* Complex Types */ GEOMETRY_MULTIPOINT *_wkb_read_geometry_multipoint(WKB *wkb); GEOMETRY_MULTILINESTRING *_wkb_read_geometry_multilinestring(WKB *wkb); GEOMETRY_MULTIPOLYGON *_wkb_read_geometry_multipolygon(WKB *wkb); #endif /* WKB_PRIV_H */
/* * Copyright (C) 2010 Igalia, S.L. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef GtkTypedefs_h #define GtkTypedefs_h /* Vanilla C code does not seem to be able to handle forward-declaration typedefs. */ #ifdef __cplusplus typedef char gchar; typedef double gdouble; typedef float gfloat; typedef int gint; typedef gint gboolean; typedef long glong; typedef short gshort; typedef unsigned char guchar; typedef unsigned int guint; typedef unsigned long gulong; typedef unsigned short gushort; typedef void* gpointer; typedef struct _GAsyncResult GAsyncResult; typedef struct _GCancellable GCancellable; typedef struct _GCharsetConverter GCharsetConverter; typedef struct _GCond GCond; typedef struct _GDir GDir; typedef struct _GdkAtom* GdkAtom; typedef struct _GdkCursor GdkCursor; typedef struct _GdkDragContext GdkDragContext; typedef struct _GdkEventConfigure GdkEventConfigure; typedef struct _GdkEventExpose GdkEventExpose; typedef struct _GdkPixbuf GdkPixbuf; typedef struct _GError GError; typedef struct _GFile GFile; typedef struct _GHashTable GHashTable; typedef struct _GInputStream GInputStream; typedef struct _GList GList; typedef struct _GMutex GMutex; typedef struct _GPatternSpec GPatternSpec; typedef struct _GPollableOutputStream GPollableOutputStream; typedef struct _GSocketClient GSocketClient; typedef struct _GSocketConnection GSocketConnection; typedef struct _GSource GSource; typedef struct _GVariant GVariant; typedef union _GdkEvent GdkEvent; #if USE(CAIRO) typedef struct _cairo_surface cairo_surface_t; typedef struct _cairo_rectangle_int cairo_rectangle_int_t; #endif #if PLATFORM(GTK) typedef struct _GtkAction GtkAction; typedef struct _GtkAdjustment GtkAdjustment; typedef struct _GtkBorder GtkBorder; typedef struct _GtkClipboard GtkClipboard; typedef struct _GtkContainer GtkContainer; typedef struct _GtkIconInfo GtkIconInfo; typedef struct _GtkMenu GtkMenu; typedef struct _GtkMenuItem GtkMenuItem; typedef struct _GtkObject GtkObject; typedef struct _GtkSelectionData GtkSelectionData; typedef struct _GtkStyle GtkStyle; typedef struct _GtkTargetList GtkTargetList; typedef struct _GtkThemeParts GtkThemeParts; typedef struct _GtkWidget GtkWidget; typedef struct _GtkWindow GtkWindow; #ifdef GTK_API_VERSION_2 typedef struct _GdkRectangle GdkRectangle; typedef struct _GdkDrawable GdkWindow; #else typedef struct _GdkWindow GdkWindow; typedef struct _GtkStyleContext GtkStyleContext; #endif #endif #endif #endif /* GtkTypedefs_h */
/* * imgread - Sanity check resdet's built in image readers. * Copyright (C) 2013-2017 0x09.net. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <stdio.h> #include <stdlib.h> #include "resdet.h" int main(int argc, char** argv) { if(argc < 2) { printf("Usage: %s input_image output.pgm", argv[0]); return 0; } unsigned char* image; size_t nimages, width, height; RDError e = resdet_read_image(argv[1], NULL, &image, &nimages, &width, &height); if(e) { fprintf(stderr,"%s\n",RDErrStr[e]); return 1; } FILE* out = fopen(argv[2], "w"); fprintf(out, "P2\n%zu %zu\n256", width, height); for(size_t i = 0; i < width*height; i++) { if(!(i%70)) fprintf(out, "\n"); fprintf(out, "%u ", image[i]); } fclose(out); free(image); }
/* BEGIN_COMMON_COPYRIGHT_HEADER * (c)LGPL2+ * * Flacon - audio File Encoder * https://github.com/flacon/flacon * * Copyright: 2012-2013 * Alexander Sokoloff <sokoloff.a@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) 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 TEST_FLACON_H #define TEST_FLACON_H #include <QObject> #include <QStringList> #include <QMap> #include <QVariant> #include <QLoggingCategory> class Disc; #define SettingsValues QMap<QString, QVariant> class TestFlacon : public QObject { Q_OBJECT public: explicit TestFlacon(QObject *parent = nullptr); static bool compareCue(const QString &result, const QString &expected, QString *error, bool skipEmptyLines = false); private: QStringList readFile(const QString &fileName); void writeFile(const QStringList &strings, const QString &fileName); QString stigListToString(const QStringList &strings, const QString divider = ""); private slots: void initTestCase(); void init(); void testCue(); void testCue_data(); void testCueData(); void testCueData_data(); void testSearchCoverImage(); void testSearchCoverImage_data(); void testReadWavHeader(); void testReadWavHeader_data(); void testResizeWavHeader(); void testResizeWavHeader_data(); void testToLegacyWav(); void testToLegacyWav_data(); void testFormatWavLast(); void testFormat(); void testFormat_data(); void testFormatFromFile(); void testFormatFromFile_data(); void testInputAudioFile(); void testInputAudioFile_data(); void testDecoder(); void testDecoder_data(); void testByteArraySplit_data(); void testByteArraySplit(); void testSafeString_data(); void testSafeString(); void testTrackResultFileName_data(); void testTrackResultFileName(); void testTrackResultFilePath_data(); void testTrackResultFilePath(); void testOutFormatEncoderArgs_data(); void testOutFormatEncoderArgs(); void testOutFormatGainArgs_data(); void testOutFormatGainArgs(); void testTrackSetCodepages_data(); void testTrackSetCodepages(); void testCueIndex_data(); void testCueIndex(); void testFindCueFile_data(); void testFindCueFile(); void testPatternExpander_data(); void testPatternExpander(); void testLoadProfiles(); void testLoadProfiles_data(); void testAudioFileMatcher(); void testAudioFileMatcher_data(); void testLoadDiscFromAudio(); void testLoadDiscFromAudio_data(); void testLoadDiscFromAudioErrors(); void testLoadDiscFromAudioErrors_data(); void testConvert(); void testConvert_data(); private: void writeTextFile(const QString &fileName, const QString &content); void writeTextFile(const QString &fileName, const QStringList &content); bool removeDir(const QString &dirName) const; bool clearDir(const QString &dirName) const; void checkFileExists(const QString &fileName); void checkFileNotExists(const QString &fileName); void applySettings(const SettingsValues &config); QString dir(const QString &subTest = ""); QString sourceDir(const QString &subTest = ""); Disc *standardDisc(); QString mFfmpeg; QString mAudio_cd_wav; QString mAudio_24x96_wav; QString mAudio_cd_ape; QString mAudio_24x96_ape; QString mAudio_cd_flac; QString mAudio_24x96_flac; QString mAudio_cd_wv; QString mAudio_24x96_wv; QString mAudio_cd_tta; QString mAudio_24x96_tta; const QString mTmpDir; const QString mDataDir; Disc *mStandardDisc; static int mTestNum; }; QStringList &operator<<(QStringList &list, int value); #endif // TEST_FLACON_H
#ifndef QSYNCUPLOADDATA_H #define QSYNCUPLOADDATA_H /* ================================================= * This file is part of the TTK Music Player project * Copyright (C) 2015 - 2020 Greedysky Studio * 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 "qsyncdatainterface.h" /*! @brief The class of the sync cloud data item. * @author Greedysky <greedysky@163.com> */ class MUSIC_EXTRAS_EXPORT QSyncUploadData : public QSyncDataInterface { Q_OBJECT public: /*! * Object contsructor. */ explicit QSyncUploadData(QNetworkAccessManager *networkManager, QObject *parent = nullptr); /*! * Get uplaod data operator. */ void uploadDataOperator(const QString &time, const QString &bucket, const QString &fileName, const QString &filePath); Q_SIGNALS: /*! * Uplaod file finshed. */ void uploadFileFinished(const QString &time); /*! * Show upload progress. */ void uploadProgressChanged(const QString &time, qint64 bytesSent, qint64 bytesTotal); protected Q_SLOTS: /*! * Receive data from server finshed. */ virtual void receiveDataFromServer() override; /*! * Show upload progress. */ void uploadProgress(qint64 bytesSent, qint64 bytesTotal); }; #endif
/*------------------------------------------------------------------------ * Copyright 2008 (c) Jeff Brown <spadix@users.sourceforge.net> * * This file is part of the Zebra Barcode Library. * * The Zebra Barcode Library is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The Zebra Barcode 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 Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the Zebra Barcode Library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zebra *------------------------------------------------------------------------*/ #ifndef _PDF417_H_ #define _PDF417_H_ /* PDF417 specific decode state */ typedef struct pdf417_decoder_s { unsigned direction : 1; /* scan direction: 0=fwd/space, 1=rev/bar */ unsigned element : 3; /* element offset 0-7 */ int character : 12; /* character position in symbol */ unsigned s8; /* character width */ unsigned config; } pdf417_decoder_t; /* reset PDF417 specific state */ static inline void pdf417_reset (pdf417_decoder_t *pdf417) { pdf417->direction = 0; pdf417->element = 0; pdf417->character = -1; pdf417->s8 = 0; } /* decode PDF417 symbols */ zebra_symbol_type_t _zebra_decode_pdf417(zebra_decoder_t *dcode); #endif
/* * RELIC is an Efficient LIbrary for Cryptography * Copyright (C) 2007-2014 RELIC Authors * * This file is part of RELIC. RELIC is legal property of its developers, * whose names are not listed here. Please refer to the COPYRIGHT file * for contact information. * * RELIC 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. * * RELIC 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 RELIC. If not, see <http://www.gnu.org/licenses/>. */ /** * @file * * Implementation of utilities in extensions defined over prime fields. * * @version $Id: relic_fpx_util.c 1867 2014-05-03 19:50:27Z dfaranha $ * @ingroup fpx */ #include "relic_core.h" #include "relic_fpx_low.h" /*============================================================================*/ /* Public definitions */ /*============================================================================*/ void fp2_copy(fp2_t c, fp2_t a) { fp_copy(c[0], a[0]); fp_copy(c[1], a[1]); } void fp2_zero(fp2_t a) { fp_zero(a[0]); fp_zero(a[1]); } int fp2_is_zero(fp2_t a) { return fp_is_zero(a[0]) && fp_is_zero(a[1]); } void fp2_rand(fp2_t a) { fp_rand(a[0]); fp_rand(a[1]); } void fp2_print(fp2_t a) { fp_print(a[0]); fp_print(a[1]); } void fp2_size_bin(int *size, const fp2_t a) { *size = FP_BYTES * 2; } void fp2_read_bin(fp2_t a, const uint8_t *bin, int len) { if (len != FP_BYTES * 2) { THROW(ERR_NO_BUFFER); } fp_read_bin(a[0], bin, FP_BYTES); fp_read_bin(a[1], bin + FP_BYTES, FP_BYTES); } void fp2_write_bin(uint8_t *bin, int len, const fp2_t a) { if (len != FP_BYTES * 2) { THROW(ERR_NO_BUFFER); } fp_write_bin(bin, FP_BYTES, a[0]); fp_write_bin(bin + FP_BYTES, FP_BYTES, a[1]); } void fp2_set_dig(fp2_t a, dig_t b) { fp_set_dig(a[0], b); fp_zero(a[1]); } void fp3_copy(fp3_t c, fp3_t a) { fp_copy(c[0], a[0]); fp_copy(c[1], a[1]); fp_copy(c[2], a[2]); } void fp3_zero(fp3_t a) { fp_zero(a[0]); fp_zero(a[1]); fp_zero(a[2]); } int fp3_is_zero(fp3_t a) { return fp_is_zero(a[0]) && fp_is_zero(a[1]) && fp_is_zero(a[2]); } void fp3_rand(fp3_t a) { fp_rand(a[0]); fp_rand(a[1]); fp_rand(a[2]); } void fp3_print(fp3_t a) { fp_print(a[0]); fp_print(a[1]); fp_print(a[2]); } void fp6_copy(fp6_t c, fp6_t a) { fp2_copy(c[0], a[0]); fp2_copy(c[1], a[1]); fp2_copy(c[2], a[2]); } void fp6_zero(fp6_t a) { fp2_zero(a[0]); fp2_zero(a[1]); fp2_zero(a[2]); } int fp6_is_zero(fp6_t a) { return fp2_is_zero(a[0]) && fp2_is_zero(a[1]) && fp2_is_zero(a[2]); } void fp6_rand(fp6_t a) { fp2_rand(a[0]); fp2_rand(a[1]); fp2_rand(a[2]); } void fp6_print(fp6_t a) { fp2_print(a[0]); fp2_print(a[1]); fp2_print(a[2]); } void fp12_copy(fp12_t c, fp12_t a) { fp6_copy(c[0], a[0]); fp6_copy(c[1], a[1]); } void fp12_zero(fp12_t a) { fp6_zero(a[0]); fp6_zero(a[1]); } int fp12_is_zero(fp12_t a) { return (fp6_is_zero(a[0]) && fp6_is_zero(a[1])); } void fp12_rand(fp12_t a) { fp6_rand(a[0]); fp6_rand(a[1]); } void fp12_print(fp12_t a) { fp6_print(a[0]); fp6_print(a[1]); } void fp12_set_dig(fp12_t a, dig_t b) { fp12_zero(a); fp_set_dig(a[0][0][0], b); } void fp18_copy(fp18_t c, fp18_t a) { fp6_copy(c[0], a[0]); fp6_copy(c[1], a[1]); fp6_copy(c[2], a[2]); } void fp18_zero(fp18_t a) { fp6_zero(a[0]); fp6_zero(a[1]); fp6_zero(a[2]); } int fp18_is_zero(fp18_t a) { return (fp6_is_zero(a[0]) && fp6_is_zero(a[1]) && fp6_is_zero(a[2])); } void fp18_rand(fp18_t a) { fp6_rand(a[0]); fp6_rand(a[1]); fp6_rand(a[2]); } void fp18_print(fp18_t a) { fp6_print(a[0]); fp6_print(a[1]); fp6_print(a[2]); } void fp18_set_dig(fp18_t a, dig_t b) { fp18_zero(a); fp_set_dig(a[0][0][0], b); }
/* * Tiny Vector Matrix Library * Dense Vector Matrix Libary of Tiny size using Expression Templates * * Copyright (C) 2001 - 2007 Olaf Petzold <opetzold@users.sourceforge.net> * * 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: Extremum.h,v 1.10 2007-06-23 15:58:58 opetzold Exp $ */ #ifndef TVMET_EXTREMUM_H #define TVMET_EXTREMUM_H namespace tvmet { /** * \class matrix_tag Extremum.h "tvmet/Extremum.h" * \brief For use with Extremum to simplify max handling. * This allows the min/max functions to return an Extremum object. */ struct matrix_tag { }; /** * \class vector_tag Extremum.h "tvmet/Extremum.h" * \brief For use with Extremum to simplify max handling. * This allows the min/max functions to return an Extremum object. */ struct vector_tag { }; /** * \class Extremum Extremum.h "tvmet/Extremum.h" * \brief Generell class for storing extremums determined by min/max. */ template<class T1, class T2, class Tag> class Extremum { }; /** * \class Extremum<T1, T2, vector_tag> Extremum.h "tvmet/Extremum.h" * \brief Partial specialzed for vectors to store extremums by value and index. */ template<class T1, class T2> class Extremum<T1, T2, vector_tag> { public: typedef T1 value_type; typedef T2 index_type; public: Extremum(value_type value, index_type index) : m_value(value), m_index(index) { } value_type value() const { return m_value; } index_type index() const { return m_index; } private: value_type m_value; index_type m_index; }; /** * \class Extremum<T1, T2, matrix_tag> Extremum.h "tvmet/Extremum.h" * \brief Partial specialzed for matrix to store extremums by value, row and column. */ template<class T1, class T2> class Extremum<T1, T2, matrix_tag> { public: typedef T1 value_type; typedef T2 index_type; public: Extremum(value_type value, index_type row, index_type col) : m_value(value), m_row(row), m_col(col) { } value_type value() const { return m_value; } index_type row() const { return m_row; } index_type col() const { return m_col; } private: value_type m_value; index_type m_row, m_col; }; } // namespace tvmet #endif // TVMET_EXTREMUM_H // Local Variables: // mode:C++ // tab-width:8 // End:
#ifndef OSGDVRTRIANGLE_H #define OSGDVRTRIANGLE_H #include <list> #include <vector> #include <OSGVector.h> #include <OSGGL.h> OSG_BEGIN_NAMESPACE //! A triangle of a triangled clipping geometry object class DVRTriangle { public: //! Constructor DVRTriangle(void); //! Copy DVRTriangle(const DVRTriangle &tri); //! Destructor ~DVRTriangle(void); //! Usefull for debugging void dump(void) const; //! set the number of additional per vertex attributes for the cutpoint /*! basically there are two attributes available, the vertex position and a 3D texture coordinate, if one needs additional attributes, e.g. color, texture coordinates,.., the number of (double) values needed has to be set with this function. */ bool setNumAddPerVertexAttr(UInt32 additionalPerVertexAttributes); // public attributes public: //! Indices of the neighbour triangles of this triangle Int32 neighbours[3]; //! Indices of the vertices of this triangle Int32 vertices[3]; //! The triangles normal Vec3f normal; // local variables public: //! The triangles normal Vec3f transformedNormal; //! A Flag. True, iff the triangle has been processed. bool visited; //! True if the triangle belongs to a contour bool inContour; //! the next triangle in the contour DVRTriangle *contourNeighbour; //! The intersection point of the triangle and the current slice that //! contributes to the contour Pnt3f cutPnt; //! The intersection point of the triangle and the current //! slice that contributes to the contour with additional texture //! coordinates, needed because GLUTesselator needs an opaque pointer. //! The first three values represent the vertex position, the next //! three the (always available) first texture coordinate for this point //! and the following values the additional per vertex attributes (if any) GLdouble *cutPoint; //! Indicates which edges are cut by the currently processed slice bool edgeCut[3]; }; //! A list of pointers to triangles, for local usage only typedef std::vector<DVRTriangle *> DVRTriangleList; OSG_END_NAMESPACE #endif
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Solutions Commercial License Agreement provided ** with the Software or, alternatively, in accordance with the terms ** contained in a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** Please note Third Party Software included with Qt Solutions may impose ** additional restrictions and it is the user's responsibility to ensure ** that they have met the licensing requirements of the GPL, LGPL, or Qt ** Solutions Commercial license and the relevant license of the Third ** Party Software they are using. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef CNTSYMBIANFILTERDBMS_H #define CNTSYMBIANFILTERDBMS_H #ifndef SYMBIAN_BACKEND_USE_SQLITE #include "cntabstractcontactfilter.h" #include <e32cmn.h> #include <cntdef.h> class CContactDatabase; class CContactIdArray; class CntAbstractContactSorter; class CntTransformContact; class CContactItemFieldDef; class CContactItemFieldSet; QTM_BEGIN_NAMESPACE class QContactDetailFilter; QTM_END_NAMESPACE QTM_USE_NAMESPACE class CntSymbianFilter : public CntAbstractContactFilter { public: CntSymbianFilter(CContactDatabase& contactDatabase); ~CntSymbianFilter(); /* from CntAbstractContactFilter */ QList<QContactLocalId> contacts(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders, bool &filterSupported, QContactManager::Error* error); bool filterSupported(const QContactFilter& filter); private: FilterSupport filterSupportLevel(const QContactFilter& filter); QList<QContactLocalId> filterContacts(const QContactFilter& filter, QContactManager::Error* error); void transformDetailFilterL(const QContactDetailFilter& detailFilter, CContactItemFieldDef*& fieldDef); TInt findContacts( CContactIdArray*& idArray, const CContactItemFieldDef& fieldDef, const TDesC& text) const; CContactIdArray* findContactsL( const CContactItemFieldDef& fieldDef, const TDesC& text) const; TInt matchContacts( CContactIdArray*& idArray, const TDesC& phoneNumber, const TInt matchLength); bool isFalsePositive(const CContactItemFieldSet& fieldSet, const TUid& fieldTypeUid, const TDesC& searchString); bool contactExists(const TContactItemId &contactId); void getMatchLengthL(TInt& matchLength); CContactDatabase &m_contactDatabase; CntAbstractContactSorter *m_contactSorter; CntTransformContact *m_transformContact; #ifdef PBK_UNIT_TEST friend class tst_cntfilteringdbms; #endif }; #endif /*SYMBIAN_BACKEND_USE_SQLITE*/ #endif /* CNTSYMBIANFILTERDBMS_H */
27 mtime=1282783898.993153 30 atime=1329255086.308583144 30 ctime=1329259670.038445114
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** Commercial Usage ** ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** 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. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** **************************************************************************/ #ifndef OUTPUTWINDOW_H #define OUTPUTWINDOW_H #include <coreplugin/ioutputpane.h> #include <QtCore/QObject> #include <QtCore/QHash> #include <QtGui/QShowEvent> #include <QtGui/QPlainTextEdit> QT_BEGIN_NAMESPACE class QTabWidget; class QToolButton; class QAction; QT_END_NAMESPACE namespace Core { class BaseContext; } namespace ProjectExplorer { class RunControl; namespace Constants { const char * const C_APP_OUTPUT = "Application Output"; } namespace Internal { class OutputWindow; class OutputPane : public Core::IOutputPane { Q_OBJECT public: OutputPane(); ~OutputPane(); QWidget *outputWidget(QWidget *); QList<QWidget*> toolBarWidgets() const; QString name() const; int priorityInStatusBar() const; void clearContents(); void visibilityChanged(bool); bool canFocus(); bool hasFocus(); void setFocus(); bool canNext(); bool canPrevious(); void goToNext(); void goToPrev(); bool canNavigate(); void appendOutput(const QString &out); // ApplicationOutputspecifics void createNewOutputWindow(RunControl *rc); void appendOutput(RunControl *rc, const QString &out); void appendOutputInline(RunControl *rc, const QString &out); void showTabFor(RunControl *rc); public slots: void projectRemoved(); void coreAboutToClose(); private slots: void insertLine(); void reRunRunControl(); void stopRunControl(); void closeTab(int index); void tabChanged(int); void runControlStarted(); void runControlFinished(); private: RunControl *runControlForTab(int index) const; QWidget *m_mainWidget; QTabWidget *m_tabWidget; QHash<RunControl *, OutputWindow *> m_outputWindows; QAction *m_stopAction; QToolButton *m_reRunButton; QToolButton *m_stopButton; }; class OutputWindow : public QPlainTextEdit { Q_OBJECT public: OutputWindow(QWidget *parent = 0); ~OutputWindow(); void appendOutput(const QString &out); void appendOutputInline(const QString &out); void insertLine(); void grayOutOldContent(); void showEvent(QShowEvent *); protected: void mousePressEvent(QMouseEvent *e); void mouseReleaseEvent(QMouseEvent *e); void mouseMoveEvent(QMouseEvent *e); private: Core::BaseContext *m_outputWindowContext; void enableUndoRedo(); QRegExp m_qmlError; bool m_enforceNewline; bool m_scrollToBottom; bool m_linksActive; bool m_mousePressed; }; #if 0 class OutputWindow : public QAbstractScrollArea { Q_OBJECT int max_lines; bool same_height; int width_used; bool block_scroll; QStringList lines; QBasicTimer autoscroll_timer; int autoscroll; QPoint lastMouseMove; struct Selection { Selection():line(0), pos(0){} int line; int pos; bool operator==(const Selection &other) const { return line == other.line && pos == other.pos; } bool operator!=(const Selection &other) const { return !(*this == other); } bool operator<(const Selection &other) const { return line < other.line || (line == other.line && pos < other.pos); } bool operator>=(const Selection &other) const { return !(*this < other); } bool operator<=(const Selection &other) const { return line < other.line || (line == other.line && pos == other.pos); } bool operator>(const Selection &other) const { return !(*this <= other); } }; Selection selection_start, selection_end; void changed(); bool getCursorPos(int *lineNumber, int *position, const QPoint &pos); public: OutputWindow(QWidget *parent = 0); ~OutputWindow(); void setNumberOfLines(int max); int numberOfLines() const; bool hasSelectedText() const; void clearSelection(); QString selectedText() const; void appendOutput(const QString &out); void insertLine() { appendOutput(QChar(QChar::ParagraphSeparator)); } public slots: void clear(); void copy(); void selectAll(); signals: void showPage(); protected: void scrollContentsBy(int dx, int dy); void keyPressEvent(QKeyEvent *e); void paintEvent(QPaintEvent *e); void mousePressEvent(QMouseEvent *e); void mouseReleaseEvent(QMouseEvent *e); void mouseMoveEvent(QMouseEvent *e); void timerEvent(QTimerEvent *e); void contextMenuEvent(QContextMenuEvent * e); }; #endif // 0 } // namespace Internal } // namespace ProjectExplorer #endif // OUTPUTWINDOW_H
/* Arduino EEPROM emulation Copyright (c) 2018 david gauchard. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with 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: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution. - The names of its contributors may not be used to endorse or promote products derived from this Software without specific prior written permission. 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 CONTRIBUTORS 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 WITH THE SOFTWARE. */ #ifndef EEPROM_MOCK #define EEPROM_MOCK class EEPROMClass { public: EEPROMClass(uint32_t sector); EEPROMClass(void); ~EEPROMClass(); void begin(size_t size); uint8_t read(int address); void write(int address, uint8_t val); bool commit(); void end(); template<typename T> T& get(int const address, T& t) { if (address < 0 || address + sizeof(T) > _size) return t; for (size_t i = 0; i < sizeof(T); i++) ((uint8_t*)&t)[i] = read(i); return t; } template<typename T> const T& put(int const address, const T& t) { if (address < 0 || address + sizeof(T) > _size) return t; for (size_t i = 0; i < sizeof(T); i++) write(i, ((uint8_t*)&t)[i]); return t; } size_t length() { return _size; } // uint8_t& operator[](int const address) { return read(address); } uint8_t operator[](int address) { return read(address); } protected: size_t _size = 0; int _fd = -1; }; #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM) extern EEPROMClass EEPROM; #endif #endif
#ifndef foodroidsourcefoo #define foodroidsourcefoo /* * Copyright (C) 2013-2022 Jolla Ltd. * * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com> * * These PulseAudio Modules are 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 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #ifdef HAVE_VALGRIND_MEMCHECK_H #include <valgrind/memcheck.h> #endif #include <pulse/xmalloc.h> #include <pulsecore/core.h> #include <pulsecore/i18n.h> #include <pulsecore/module.h> #include <pulsecore/source.h> #include <pulsecore/modargs.h> #include <pulsecore/log.h> #include <pulsecore/macro.h> #include <pulsecore/card.h> #include <droid/droid-util.h> pa_source *pa_droid_source_new(pa_module *m, pa_modargs *ma, const char *driver, pa_droid_card_data *card_data, pa_droid_mapping *am, pa_card *card); void pa_droid_source_free(pa_source *s); #endif
/* * Copyright (c) 2013 Red Hat, Inc. * * 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 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, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Author: Alexander Larsson <alexl@redhat.com> * */ #ifndef __GTK_REVEALER_H__ #define __GTK_REVEALER_H__ #include <gtk/gtkbin.h> G_BEGIN_DECLS #define GTK_TYPE_REVEALER (gtk_revealer_get_type ()) #define GTK_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_REVEALER, GtkRevealer)) #define GTK_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_REVEALER, GtkRevealerClass)) #define GTK_IS_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_REVEALER)) #define GTK_IS_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_REVEALER)) #define GTK_REVEALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_REVEALER, GtkRevealerClass)) typedef struct _GtkRevealer GtkRevealer; typedef struct _GtkRevealerClass GtkRevealerClass; typedef struct _GtkRevealerPrivate GtkRevealerPrivate; typedef enum { GTK_REVEALER_TRANSITION_TYPE_NONE, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE, GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT, GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT, GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN } GtkRevealerTransitionType; struct _GtkRevealer { GtkBin parent_instance; GtkRevealerPrivate * priv; }; struct _GtkRevealerClass { GtkBinClass parent_class; }; GDK_AVAILABLE_IN_3_10 GType gtk_revealer_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_3_10 GtkWidget* gtk_revealer_new (void); GDK_AVAILABLE_IN_3_10 gboolean gtk_revealer_get_reveal_child (GtkRevealer *revealer); GDK_AVAILABLE_IN_3_10 void gtk_revealer_set_reveal_child (GtkRevealer *revealer, gboolean reveal_child); GDK_AVAILABLE_IN_3_10 gboolean gtk_revealer_get_child_revealed (GtkRevealer *revealer); GDK_AVAILABLE_IN_3_10 guint gtk_revealer_get_transition_duration (GtkRevealer *revealer); GDK_AVAILABLE_IN_3_10 void gtk_revealer_set_transition_duration (GtkRevealer *revealer, guint duration); GDK_AVAILABLE_IN_3_10 void gtk_revealer_set_transition_type (GtkRevealer *revealer, GtkRevealerTransitionType transition); GDK_AVAILABLE_IN_3_10 GtkRevealerTransitionType gtk_revealer_get_transition_type (GtkRevealer *revealer); G_END_DECLS #endif
/* QExt: Extensions to Qt * Copyright (C) 2016 Jonathan Harper * * 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 QE_CORE_POINTER_DELETERS_H #define QE_CORE_POINTER_DELETERS_H #include <cstdlib> #ifndef QEXT_CORE_NO_QT #include <QtCore/QObject> #endif namespace qe { //! The default deleter used with \ref qe::UniquePointer. //! Unless you are using something other than `new` to construct your data, //! this works fine. template <class T> struct DefaultDeleter { static void cleanup(T *ptr) { static_assert (sizeof (T) > 0, "DefaultDeleter requires a complete type on cleanup."); delete ptr; } }; //! This deleter calls 'free()` on a `void` pointer. struct PodDeleter { static void cleanup(void *pointer) { if (pointer) free(pointer); } }; #ifndef QEXT_CORE_NO_QT //! This deleter is exclusively for scheduling a `QObject` for deletion. struct ObjectDeleter { static void cleanup(QObject *pointer) { if (pointer) pointer->deleteLater(); } }; #endif //QEXT_CORE_NO_QT } // namespace qe #ifndef QEXT_NO_CLUTTER //! \relates qe::DefaultDeleter template <class T> using QeDefaultDeleter = qe::DefaultDeleter<T>; //! \relates qe::ObjectDeleter using QeObjectDeleter = qe::ObjectDeleter; //! \relates qe::PodDeleter using QePodDeleter = qe::PodDeleter; #endif //QEXT_NO_CLUTTER #endif //QE_CORE_POINTER_DELETERS_H
/* * ks0108_Teensy.h - User specific configuration for Arduino GLCD library * * Use this file to set io pins * This version is for a standard ks0108 display * connected to a Teensy or Teensy++ * * Note that the Teensy and Teensy++ use different pin numbers * so make sure that your wiring matches the device you are using * */ #ifndef GLCD_PIN_CONFIG_H #define GLCD_PIN_CONFIG_H /**********************************************************/ /* Configuration for assigning LCD bits to Teensy++ Pins */ /**********************************************************/ /* * Pins can be assigned using Arduino pin numbers 0-n * Pins can also be assigned using PIN_Pb * where P is port A-L and b is bit 0-7 * Example: port D bit 3 is PIN_D3 * */ #if defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) // Teensy++ #define glcd_PinConfigName "ks0108-Teensy++" // define name for configuration /* * Arduino pin AVR pin */ #define glcdCSEL1 18 // PIN_E6 #define glcdCSEL2 19 // PIN_E7 #define glcdRW 8 // PIN_E0 #define glcdDI 9 // PIN_E1 #define glcdEN 7 // PIN_D7 //#define glcdRES 5 // PIN_D5 #if NBR_CHIP_SELECT_PINS > 2 #error Missing glcdCSEL3 define //#define glcdCSEL3 ? // third chip select if needed #endif #if NBR_CHIP_SELECT_PINS > 3 #error Missing glcdCSEL4 define //#define glcdCSEL4 ? // fourth chip select if needed #endif #define glcdData0Pin 10 // PIN_C0 #define glcdData1Pin 11 // PIN_C1 #define glcdData2Pin 12 // PIN_C2 #define glcdData3Pin 13 // PIN_C3 #define glcdData4Pin 14 // PIN_C4 #define glcdData5Pin 15 // PIN_C5 #define glcdData6Pin 16 // PIN_C6 #define glcdData7Pin 17 // PIN_C7 #warning "KS0108 using pins for teensy++" /*********************************************************/ /* Configuration for assigning LCD bits to Teensy Pins */ /*********************************************************/ #elif defined(__AVR_ATmega32U4__) // Teensy 2.0 #define glcd_PinConfigName "ks0108-Teensy" // define name for configuration /* * Arduino pin AVR pin */ #define glcdCSEL1 7 // PIN_D2 // normal connection for control signals #define glcdCSEL2 8 // PIN_D3 #define glcdRW 6 // PIN_D1 #define glcdDI 5 // PIN_D0 #define glcdEN 9 // PIN_C6 //#define glcdRES 17 //PIN_F6 // Reset Bit #if NBR_CHIP_SELECT_PINS > 2 #error Missing glcdCSEL3 define //#define glcdCSEL3 ? // third chip select if needed #endif #if NBR_CHIP_SELECT_PINS > 3 #error Missing glcdCSEL4 define //#define glcdCSEL4 ? // fourth chip select if needed #endif #define glcdData0Pin 0 // PIN_B0 #define glcdData1Pin 1 // PIN_B1 #define glcdData2Pin 2 // PIN_B2 #define glcdData3Pin 3 // PIN_B3 #define glcdData4Pin 13 // PIN_B4 #define glcdData5Pin 14 // PIN_B5 #define glcdData6Pin 15 // PIN_B6 #define glcdData7Pin 4 // PIN_B7 #warning "KS0108 using pins for teensy 2.0" #endif #endif //GLCD_PIN_CONFIG_H
/* lib_gadtools/s_newgadget.h - Header file for gadtools.library struct NewGadget Copyright (C) 2010 Magnus Öberg The license for this program is dual license: AROS Public License, version 1.1 or later (APL1.1+) AND GNU Lesser General Public License, version 2.1 or later (LGPL2.1+) Dual licensing means for this program that anyone that wants to use, modify or distribute all or parts of this program can choose the best suiting license of APL1.1+ or LGPL2.1+ and must follow the terms described in that license. Choosing only one license disables the other license and references to the disabled license in code and documentation may be removed. This text paragraph should be removed at the same time. It is also permitted to keep this exact dual licensing. The copyrights are not affected by selecting only one license and remain in full. -- APL conditions -- The contents of this file are subject to the AROS Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.aros.org/license.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. -- LGPL conditions -- 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 Street, Fifth Floor, Boston, MA 02110-1301 USA -- */ #ifndef _LIB_GADTOOLS_S_NEWGADGET_H_ #define _LIB_GADTOOLS_S_NEWGADGET_H_ #include <stdint.h> #include <libraries/gadtools.h> #include "../mmu/mmu.h" /* Kickstart 2.0 */ #define LIB_GADTOOLS_S_NEWGADGET_SIZE 30 /* Structure for simulated object */ struct lib_gadtools_s_newgadget_struct { mmu_entry_t *entry; struct NewGadget *real; int userSpace; uint8_t gadgettext_wtmp[4]; uint8_t gadgettext_wmask; uint32_t gadgettext_vaddr; }; typedef struct lib_gadtools_s_newgadget_struct lib_gadtools_s_newgadget_t; /* Predecls */ int lib_gadtools_s_newgadget_init(); void lib_gadtools_s_newgadget_cleanup(); lib_gadtools_s_newgadget_t *lib_gadtools_s_newgadget_get_real(struct NewGadget *real); lib_gadtools_s_newgadget_t *lib_gadtools_s_newgadget_get_vaddr(uint32_t vaddr); #endif
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QRADIOBUTTON_H #define QRADIOBUTTON_H #include <QtGui/qabstractbutton.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Gui) class QRadioButtonPrivate; class QStyleOptionButton; class Q_GUI_EXPORT QRadioButton : public QAbstractButton { Q_OBJECT public: explicit QRadioButton(QWidget *parent=0); explicit QRadioButton(const QString &text, QWidget *parent=0); QSize sizeHint() const; protected: bool event(QEvent *e); bool hitButton(const QPoint &) const; void paintEvent(QPaintEvent *); void mouseMoveEvent(QMouseEvent *); void initStyleOption(QStyleOptionButton *button) const; #ifdef QT3_SUPPORT public: QT3_SUPPORT_CONSTRUCTOR QRadioButton(QWidget *parent, const char* name); QT3_SUPPORT_CONSTRUCTOR QRadioButton(const QString &text, QWidget *parent, const char* name); #endif private: Q_DECLARE_PRIVATE(QRadioButton) Q_DISABLE_COPY(QRadioButton) }; QT_END_NAMESPACE QT_END_HEADER #endif // QRADIOBUTTON_H
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef DISPLACEDSYSTEM_H #define DISPLACEDSYSTEM_H #include "SystemBase.h" // libMesh include #include "libmesh/transient_system.h" #include "libmesh/explicit_system.h" // Forward declarations class DisplacedProblem; class DisplacedSystem : public SystemBase { public: DisplacedSystem(DisplacedProblem & problem, SystemBase & undisplaced_system, const std::string & name, Moose::VarKindType var_kind); virtual ~DisplacedSystem(); virtual void init() override; virtual NumericVector<Number> & getVector(const std::string & name) override; virtual NumericVector<Number> & serializedSolution() override { return _undisplaced_system.serializedSolution(); } virtual const NumericVector<Number> * & currentSolution() override { return _undisplaced_system.currentSolution(); } virtual NumericVector<Number> & solution() override { return _undisplaced_system.solution(); } virtual NumericVector<Number> & solutionUDot() override { return _undisplaced_system.solutionUDot(); } virtual Number & duDotDu() override { return _undisplaced_system.duDotDu(); } /** * Return the residual copy from the NonlinearSystem * @return Residual copy */ virtual NumericVector<Number> & residualCopy() override { return _undisplaced_system.residualCopy(); } virtual NumericVector<Number> & residualGhosted() override { return _undisplaced_system.residualGhosted(); } virtual void augmentSendList(std::vector<dof_id_type> & send_list) override { _undisplaced_system.augmentSendList(send_list); } /** * This is an empty function since the displaced system doesn't have a matrix! * All sparsity pattern modification will be taken care of by the undisplaced system directly */ virtual void augmentSparsity(SparsityPattern::Graph & /*sparsity*/, std::vector<dof_id_type> & /*n_nz*/, std::vector<dof_id_type> & /*n_oz*/) override {} /** * Adds this variable to the list of variables to be zeroed during each residual evaluation. * @param var_name The name of the variable to be zeroed. */ virtual void addVariableToZeroOnResidual(std::string var_name) override { _undisplaced_system.addVariableToZeroOnResidual(var_name); } /** * Adds this variable to the list of variables to be zeroed during each jacobian evaluation. * @param var_name The name of the variable to be zeroed. */ virtual void addVariableToZeroOnJacobian(std::string var_name) override { _undisplaced_system.addVariableToZeroOnJacobian(var_name); } /** * Zero out the solution for the list of variables passed in. */ virtual void zeroVariables(std::vector<std::string> & vars_to_be_zeroed) override { _undisplaced_system.zeroVariables(vars_to_be_zeroed); } virtual NumericVector<Number> & solutionOld() override { return *_sys.old_local_solution; } virtual NumericVector<Number> & solutionOlder() override { return *_sys.older_local_solution; } virtual NumericVector<Number> * solutionPreviousNewton() override { return NULL; } virtual TransientExplicitSystem & sys() { return _sys; } virtual System & system() override { return _sys; } protected: SystemBase & _undisplaced_system; TransientExplicitSystem & _sys; }; #endif /* DISPLACEDSYSTEM_H */
#undef CLUTTER_DISABLE_DEPRECATED #include <clutter/clutter.h> #include <cogl/cogl.h> #include "test-conform-common.h" #define BLOCK_SIZE 16 /* Number of pixels at the border of a block to skip when verifying */ #define TEST_INSET 1 static const ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff }; typedef enum { /* The first frame is drawn using clutter_cairo_texture_create. The second frame is an update of the first frame using clutter_cairo_texture_create_region. The states are stored like this because the cairo drawing is done on idle and the validation is done during paint and we need to synchronize the two */ TEST_BEFORE_DRAW_FIRST_FRAME, TEST_BEFORE_VALIDATE_FIRST_FRAME, TEST_BEFORE_DRAW_SECOND_FRAME, TEST_BEFORE_VALIDATE_SECOND_FRAME, TEST_DONE } TestProgress; typedef struct _TestState { ClutterActor *stage; ClutterActor *ct; guint frame; TestProgress progress; } TestState; static void validate_part (int block_x, int block_y, const ClutterColor *color) { guint8 data[BLOCK_SIZE * BLOCK_SIZE * 4]; int x, y; cogl_read_pixels (block_x * BLOCK_SIZE, block_y * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, COGL_READ_PIXELS_COLOR_BUFFER, COGL_PIXEL_FORMAT_RGBA_8888_PRE, data); for (x = 0; x < BLOCK_SIZE - TEST_INSET * 2; x++) for (y = 0; y < BLOCK_SIZE - TEST_INSET * 2; y++) { const guint8 *p = data + ((x + TEST_INSET) * 4 + (y + TEST_INSET) * BLOCK_SIZE * 4); g_assert_cmpint (p[0], ==, color->red); g_assert_cmpint (p[1], ==, color->green); g_assert_cmpint (p[2], ==, color->blue); } } static void paint_cb (ClutterActor *actor, TestState *state) { static const ClutterColor red = { 0xff, 0x00, 0x00, 0xff }; static const ClutterColor green = { 0x00, 0xff, 0x00, 0xff }; static const ClutterColor blue = { 0x00, 0x00, 0xff, 0xff }; if (state->frame++ < 2) return; switch (state->progress) { case TEST_BEFORE_DRAW_FIRST_FRAME: case TEST_BEFORE_DRAW_SECOND_FRAME: case TEST_DONE: /* Handled by the idle callback */ break; case TEST_BEFORE_VALIDATE_FIRST_FRAME: /* In the first frame there is a red rectangle next to a green rectangle */ validate_part (0, 0, &red); validate_part (1, 0, &green); state->progress = TEST_BEFORE_DRAW_SECOND_FRAME; break; case TEST_BEFORE_VALIDATE_SECOND_FRAME: /* The second frame is the same except the green rectangle is replaced with a blue one */ validate_part (0, 0, &red); validate_part (1, 0, &blue); state->progress = TEST_DONE; break; } } static gboolean idle_cb (gpointer data) { TestState *state = data; cairo_t *cr; if (state->frame < 2) clutter_actor_queue_redraw (CLUTTER_ACTOR (state->stage)); else switch (state->progress) { case TEST_BEFORE_DRAW_FIRST_FRAME: /* Draw two different colour rectangles */ cr = clutter_cairo_texture_create (CLUTTER_CAIRO_TEXTURE (state->ct)); cairo_save (cr); cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); cairo_save (cr); cairo_rectangle (cr, 0, 0, BLOCK_SIZE, BLOCK_SIZE); cairo_clip (cr); cairo_set_source_rgb (cr, 1.0, 0.0, 0.0); cairo_paint (cr); cairo_restore (cr); cairo_rectangle (cr, BLOCK_SIZE, 0, BLOCK_SIZE, BLOCK_SIZE); cairo_clip (cr); cairo_set_source_rgb (cr, 0.0, 1.0, 0.0); cairo_paint (cr); cairo_restore (cr); cairo_destroy (cr); state->progress = TEST_BEFORE_VALIDATE_FIRST_FRAME; break; case TEST_BEFORE_DRAW_SECOND_FRAME: /* Replace the second rectangle with a blue one */ cr = clutter_cairo_texture_create (CLUTTER_CAIRO_TEXTURE (state->ct)); cairo_rectangle (cr, BLOCK_SIZE, 0, BLOCK_SIZE, BLOCK_SIZE); cairo_set_source_rgb (cr, 0.0, 0.0, 1.0); cairo_fill (cr); cairo_destroy (cr); state->progress = TEST_BEFORE_VALIDATE_SECOND_FRAME; break; case TEST_BEFORE_VALIDATE_FIRST_FRAME: case TEST_BEFORE_VALIDATE_SECOND_FRAME: /* Handled by the paint callback */ break; case TEST_DONE: clutter_main_quit (); break; } return TRUE; } void test_clutter_cairo_texture (TestConformSimpleFixture *fixture, gconstpointer data) { TestState state; unsigned int idle_source; unsigned int paint_handler; state.frame = 0; state.stage = clutter_stage_get_default (); state.progress = TEST_BEFORE_DRAW_FIRST_FRAME; state.ct = clutter_cairo_texture_new (BLOCK_SIZE * 2, BLOCK_SIZE); clutter_container_add_actor (CLUTTER_CONTAINER (state.stage), state.ct); clutter_stage_set_color (CLUTTER_STAGE (state.stage), &stage_color); /* We force continuous redrawing of the stage, since we need to skip * the first few frames, and we wont be doing anything else that * will trigger redrawing. */ idle_source = g_idle_add (idle_cb, &state); paint_handler = g_signal_connect_after (state.stage, "paint", G_CALLBACK (paint_cb), &state); clutter_actor_show (state.stage); clutter_main (); g_signal_handler_disconnect (state.stage, paint_handler); g_source_remove (idle_source); if (g_test_verbose ()) g_print ("OK\n"); }
#ifndef _SEMAPHORE_H #define _SEMAPHORE_H #if defined(OS_FREERTOS) #include "FreeRTOS.h" #include "task.h" #include "timers.h" #include "semphr.h" #elif defined(OS_UCOS) #include <os.h> #endif #include "time.h" #undef sem_init #undef sem_destroy #undef sem_post #undef sem_wait #undef sem_timedwait #undef sem_t #if defined(OS_UCOS) #define sem_t OS_SEM #elif defined(OS_FREERTOS) #define sem_t SemaphoreHandle_t #endif #define SEM_MAX_COUNT 999 //sem_init() returns 0 on success; on error, -1 is returned, and errno is set to indicate the error. int sem_init(sem_t *sem, int pshared, unsigned int value); //sem_destroy() returns 0 on success; on error, -1 is returned, and errno is set to indicate the error. int sem_destroy(sem_t *sem); //sem_post() returns 0 on success; on error, the value of the semaphore is left unchanged, -1 is returned, and errno is set to indicate the error. // do not call from iSR int sem_post(sem_t *sem); //All of these functions (wait) return 0 on success; on error, the value of the semaphore is left unchanged, -1 is returned, and errno is set to indicate the error. // do not call from iSR int sem_wait(sem_t *sem); int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout); #endif
/*************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (directui@nokia.com) ** ** This file is part of libmeegotouch. ** ** If you have questions regarding the use of this file, please contact ** Nokia at directui@nokia.com. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation ** and appearing in the file LICENSE.LGPL included in the packaging ** of this file. ** ****************************************************************************/ #ifndef UT_MINPUTMETHODSTATE_H #define UT_MINPUTMETHODSTATE_H #include <QtTest/QtTest> #include <QObject> #include <memory> #include "mapplication.h" class Ut_MInputMethodState : public QObject { Q_OBJECT private slots: // Called before the first testfunction is executed void initTestCase(); // Called after the last testfunction was executed void cleanupTestCase(); // Called before each testfunction is executed void init(); // Called after every testfunction void cleanup(); void testActiveWindowOrientationAngle(); void testInputMethodArea(); void testToolbars(); void testExtendedAttributes(); private: std::auto_ptr<MApplication> m_app; }; #endif
/* This file is part of RIBS2.0 (Robust Infrastructure for Backend Systems). RIBS is an infrastructure for building great SaaS applications (but not limited to). Copyright (C) 2012,2013,2014 Adap.tv, Inc. RIBS 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 2.1 of the License. RIBS 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 RIBS. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _HTTP_SERVER__H_ #define _HTTP_SERVER__H_ #include "ribs_defs.h" #include "ctx_pool.h" #include "vmbuf.h" #include "sstr.h" #include "timeout_handler.h" #include "hashtable.h" #include "uri_decode.h" #include "http_headers.h" #ifdef RIBS2_SSL #include <openssl/ssl.h> #endif struct http_server_context { int fd; struct http_server *server; struct vmbuf request; struct vmbuf header; struct vmbuf payload; char *uri; char *headers; char *query; char *content; uint32_t content_len; int persistent; char user_data[]; }; struct http_server { int fd; uint16_t port; struct ctx_pool ctx_pool; void (*user_func)(void); /* misc ctx */ struct ribs_context *accept_ctx; struct ribs_context *idle_ctx; struct timeout_handler timeout_handler; size_t stack_size; /* set to zero for auto */ size_t num_stacks; /* set to zero for auto */ size_t init_request_size; size_t init_header_size; size_t init_payload_size; size_t max_req_size; size_t context_size; uint32_t bind_addr; #ifdef RIBS2_SSL int use_ssl; SSL_CTX *ssl_ctx; char *cipher_list; char *privatekey_file; char *certificate_chain_file; #endif int (*http_server_read)(struct http_server_context *ctx); int (*http_server_write)(struct http_server_context *ctx); int (*http_server_sendfile)(struct http_server_context *ctx, int ffd, ssize_t size); }; #define _HTTP_SERVER_INIT .port = 0, .stack_size = 0, .num_stacks = 0, .init_request_size = 8*1024, .init_header_size = 8*1024, .init_payload_size = 8*1024, .max_req_size = 0, .context_size = 0, .timeout_handler.timeout = 60000, .bind_addr = INADDR_ANY, .http_server_read = NULL, .http_server_write = NULL, .http_server_sendfile = NULL #ifdef RIBS2_SSL #define _HTTP_SERVER_SSL_INIT .use_ssl = 0, .cipher_list = NULL, .privatekey_file = NULL, .certificate_chain_file = NULL #else #define _HTTP_SERVER_SSL_INIT #endif #define HTTP_SERVER_INITIALIZER { _HTTP_SERVER_INIT, _HTTP_SERVER_SSL_INIT } #define HTTP_SERVER_NOT_FOUND (-2) int http_server_init(struct http_server *server); #ifdef RIBS2_SSL int http_server_init_ssl(struct http_server *server); #endif int http_server_init2(struct http_server *server); int http_server_init_acceptor(struct http_server *server); void http_server_header_start(const char *status, const char *content_type); void http_server_header_start_no_body(const char *status); void http_server_header_close(void); void http_server_header_no_cache(void); void http_server_set_cookie(const char *name, const char *value, uint32_t max_age, const char *path, const char *domain); void http_server_set_session_cookie(const char *name, const char *value, const char *path); struct vmbuf *http_server_begin_cookie(const char *name); struct vmbuf *http_server_end_cookie(time_t expires, const char *domain, const char *path); void http_server_response(const char *status, const char *content_type); void http_server_response_sprintf(const char *status, const char *content_type, const char *format, ...) __attribute__ ((format (gnu_printf, 3, 4))); void http_server_response_vsprintf(const char *status, const char *content_type, const char *format, va_list ap); void http_server_header_redirect(const char *format, ...); void http_server_header_vredirect(const char *format, va_list ap); void http_server_redirect(const char *status, const char *content_type, const char *format, ...); void http_server_vredirect(const char *status, const char *content_type, const char *format, va_list ap); void http_server_header_content_length(void); void http_server_fiber_main(void); int http_server_sendfile(const char *filename); int http_server_sendfile2(const char *filename, const char *additional_headers, const char *ext); int http_server_sendfile_payload(int ffd, off_t size); int http_server_generate_dir_list(const char *filename); void http_server_close(struct http_server *server); /* * inline */ static inline struct http_server_context *http_server_get_context(void) { return (struct http_server_context *)(current_ctx->reserved); } static inline void *http_server_get_app_context(struct http_server_context *http_server_ctx) { return http_server_ctx->user_data; } static inline void http_server_decode_uri(char *decoded) { struct http_server_context *ctx = http_server_get_context(); http_uri_decode(ctx->uri, decoded); } static inline void http_server_parse_query_params(struct hashtable *query_params) { struct http_server_context *ctx = http_server_get_context(); http_uri_decode_query_params(ctx->query, query_params); } #endif // _HTTP_SERVER__H_
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** Commercial Usage ** ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** 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. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** **************************************************************************/ #ifndef GENERICPROJECTMANAGER_H #define GENERICPROJECTMANAGER_H #include <projectexplorer/iprojectmanager.h> namespace GenericProjectManager { namespace Internal { class GenericProject; class Manager: public ProjectExplorer::IProjectManager { Q_OBJECT public: Manager(); virtual ~Manager(); virtual int projectContext() const; virtual int projectLanguage() const; virtual QString mimeType() const; virtual ProjectExplorer::Project *openProject(const QString &fileName); void notifyChanged(const QString &fileName); void registerProject(GenericProject *project); void unregisterProject(GenericProject *project); private: int m_projectContext; int m_projectLanguage; QList<GenericProject *> m_projects; }; } // namespace Internal } // namespace GenericProjectManager #endif // GENERICPROJECTMANAGER_H
#pragma once ///--- Load OpenGL here (GLEW is for cross platform) #include <GL/glew.h> //< must be before glfw ///--- Linux needs extensions for framebuffers #if __unix__ #define GL_GLEXT_PROTOTYPES 1 #include <GL/gl.h> #include <GL/glext.h> #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_UPDATEREGEXPATTERNSETRESPONSE_H #define QTAWS_UPDATEREGEXPATTERNSETRESPONSE_H #include "wafregionalresponse.h" #include "updateregexpatternsetrequest.h" namespace QtAws { namespace WAFRegional { class UpdateRegexPatternSetResponsePrivate; class QTAWSWAFREGIONAL_EXPORT UpdateRegexPatternSetResponse : public WAFRegionalResponse { Q_OBJECT public: UpdateRegexPatternSetResponse(const UpdateRegexPatternSetRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const UpdateRegexPatternSetRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(UpdateRegexPatternSetResponse) Q_DISABLE_COPY(UpdateRegexPatternSetResponse) }; } // namespace WAFRegional } // namespace QtAws #endif
// Created file "Lib\src\strmiids\strmiids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(CODECAPI_AVEncStatWMVCBAvg, 0x6aa6229f, 0xd602, 0x4b9d, 0xb6, 0x8c, 0xc1, 0xad, 0x78, 0x88, 0x4b, 0xef);
/* cproxy - Copyright (C) 2012 Aaron Riekenberg (aaron.riekenberg@gmail.com). cproxy 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. cproxy 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 cproxy. If not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> #include "linkedlist.h" #include "memutil.h" #include <string.h> void initializeLinkedList( struct LinkedList* list) { assert(list != NULL); memset(list, 0, sizeof(struct LinkedList)); } void addToLinkedList( struct LinkedList* list, void* data) { struct LinkedListNode* node; assert(list != NULL); node = checkedCalloc(1, sizeof(struct LinkedListNode)); node->data = data; if (list->tail == NULL) { list->head = node; list->tail = node; } else { list->tail->next = node; node->prev = list->tail; list->tail = node; } ++(list->size); } void removeFromLinkedList( struct LinkedList* list, void* data) { struct LinkedListNode* currentNode; assert(list != NULL); for (currentNode = list->head; currentNode; currentNode = currentNode->next) { if (currentNode->data == data) { break; } } if (currentNode) { if (list->head == currentNode) { list->head = currentNode->next; } if (list->tail == currentNode) { list->tail = currentNode->prev; } if (currentNode->prev) { currentNode->prev->next = currentNode->next; } if (currentNode->next) { currentNode->next->prev = currentNode->prev; } free(currentNode); --(list->size); } }
// Created file "Lib\src\mfuuid\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(GUID_LIDSWITCH_STATE_CHANGE, 0xba3e0f4d, 0xb817, 0x4094, 0xa2, 0xd1, 0xd5, 0x63, 0x79, 0xe6, 0xa0, 0xf3);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DELETEARCHIVERESPONSE_P_H #define QTAWS_DELETEARCHIVERESPONSE_P_H #include "cloudwatcheventsresponse_p.h" namespace QtAws { namespace CloudWatchEvents { class DeleteArchiveResponse; class DeleteArchiveResponsePrivate : public CloudWatchEventsResponsePrivate { public: explicit DeleteArchiveResponsePrivate(DeleteArchiveResponse * const q); void parseDeleteArchiveResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(DeleteArchiveResponse) Q_DISABLE_COPY(DeleteArchiveResponsePrivate) }; } // namespace CloudWatchEvents } // namespace QtAws #endif
// Created file "Lib\src\Uuid\X64\i_mshtml" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(DIID_HTMLLinkElementEvents2, 0x3050f61d, 0x98b5, 0x11cf, 0xbb, 0x82, 0x00, 0xaa, 0x00, 0xbd, 0xce, 0x0b);
/* * tests/stdio/printf_format.c * Copyright 2016 Zane J Cersovsky * Tests to make sure printf() acts normally when format contains escaped % */ #include <stdio.h> int main () { printf("%% Hel%%lo %%\n"); return 0; }
#import "RequiredAppUIKit.h" #import "RequiredCoreGraphics.h" #import "GKImage.h" OBJC_DECLARE_CATEGORY_EXPORT(GKImage,CoreGraphics); @interface GKImage (CoreGraphics) - (CGImageRef)imageRefRetainedCopy; + (instancetype)imageWithCGImage:(CGImageRef)imageRef; @end
// Created file "Lib\src\Uuid\X64\shguids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IPropertyEnumType, 0x11e1fbf9, 0x2d56, 0x4a6b, 0x8d, 0xb3, 0x7c, 0xd1, 0x93, 0xa4, 0x71, 0xf2);
/* * ISO 8859-8 codepage (Hebrew) function * * Copyright (c) 2008-2014, Joachim Metz <joachim.metz@gmail.com> * * Refer to AUTHORS for acknowledgements. * * This software 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. * * This software 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 this software. If not, see <http://www.gnu.org/licenses/>. */ #include <common.h> #include <types.h> #include "libuna_codepage_iso_8859_8.h" /* Extended ASCII to Unicode character lookup table for ISO 8859-8 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_iso_8859_8_byte_stream_to_unicode_base_0xa0[ 96 ] = { 0x00a0, 0xfffd, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x2017, 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, 0x05e8, 0x05e9, 0x05ea, 0xfffd, 0xfffd, 0x200e, 0x200f, 0xfffd }; /* Unicode to ASCII character lookup table for ISO 8859-8 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x00a0[ 32 ] = { 0xa0, 0x1a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0x1a, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0x1a, 0xbb, 0xbc, 0xbd, 0xbe, 0x1a }; const uint8_t libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x05d0[ 32 ] = { 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a };
#ifndef __TESTNGPP_SIMPLE_TEST_SUITE_RESULT_REPORTER_H #define __TESTNGPP_SIMPLE_TEST_SUITE_RESULT_REPORTER_H #include <testngpp/testngpp.h> #include <testngpp/listener/TestSuiteListener.h> #include <testngpp/listener/TestSuiteResultReporter.h> TESTNGPP_NS_START struct TestCaseResultReporter; struct SimpleTestSuiteResultReporterImpl; struct SimpleTestSuiteResultReporter : public TestSuiteResultReporter , public TestSuiteListener { SimpleTestSuiteResultReporter(TestCaseResultReporter*); ~SimpleTestSuiteResultReporter(); //////////////////////////////////////////////////////////// int getNumberOfTestCases(TestSuiteInfoReader*) const; int getNumberOfSuccessfulTestCases(TestSuiteInfoReader*) const; int getNumberOfUnsuccessfulTestCases(TestSuiteInfoReader*) const; int getNumberOfFailedTestCases(TestSuiteInfoReader*) const; int getNumberOfErrorTestCases(TestSuiteInfoReader*) const; int getNumberOfSkippedTestCases(TestSuiteInfoReader*) const; int getNumberOfCrashedTestCases(TestSuiteInfoReader*) const; int getNumberOfFixtures(TestSuiteInfoReader*) const; int getNumberOfFixtureErrors(TestSuiteInfoReader*) const; int getNumberOfFixtureFailures(TestSuiteInfoReader*) const; int getNumberOfSuiteErrors(TestSuiteInfoReader*) const; //////////////////////////////////////////////////////////// void addCaseError(const TestCaseInfoReader*, const std::string&); void addCaseCrash(const TestCaseInfoReader*); void addCaseSkipped(const TestCaseInfoReader*); void addCaseFailure(const TestCaseInfoReader*, const AssertionFailure&); void startTestCase(const TestCaseInfoReader*); void endTestCase(const TestCaseInfoReader*, unsigned int, unsigned int); void startTestFixture(TestFixtureInfoReader*); void endTestFixture(TestFixtureInfoReader*); void addFixtureError(TestFixtureInfoReader*, const std::string&); void addFixtureFailure(TestFixtureInfoReader*, const AssertionFailure&); void startTestSuite(TestSuiteInfoReader*); void endTestSuite(TestSuiteInfoReader*); void addSuiteError(TestSuiteInfoReader*, const std::string&); private: SimpleTestSuiteResultReporterImpl* This; }; TESTNGPP_NS_END #endif
#ifndef BUNDLESYSTEMSMODEL_H #define BUNDLESYSTEMSMODEL_H #include <QAbstractListModel> #include <QModelIndex> #include <QPixmap> #include <QPointer> #include "types.h" #include "util.h" #include "oijob.h" using namespace oi; /*! * \brief The BundleSystemsModel class * Model that holds all available bundle systems */ class BundleSystemsModel : public QAbstractListModel { Q_OBJECT public: explicit BundleSystemsModel(QObject *parent = 0); //####################################### //override methods of abstract item model //####################################### int rowCount(const QModelIndex & parent = QModelIndex()) const; int columnCount(const QModelIndex & parent = QModelIndex()) const; QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; Qt::ItemFlags flags(const QModelIndex &index) const; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); //############################### //get or set current OpenIndy job //############################### const QPointer<OiJob> &getCurrentJob() const; void setCurrentJob(const QPointer<OiJob> &job); //################### //get selected system //################### int getSelectedBundleSystem(const QModelIndex &index); signals: //######################### //send messages to OpenIndy //######################### void sendMessage(const QString &msg, const MessageTypes &msgType, const MessageDestinations &msgDest = eConsoleMessage); private slots: //########################################### //update the model when bundle systems change //########################################### void updateModel(); private: //############## //helper methods //############## void connectJob(); void disconnectJob(); //callbacks OiJob void featureSetChanged(); private: //############## //helper methods //############## QList<QPointer<CoordinateSystem> > bundleSystems; //########### //current job //########### QPointer<OiJob> currentJob; }; #endif // BUNDLESYSTEMSMODEL_H
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ASLocalizer.h * * Copyright (C) 2006-2013 by Jim Pattee <jimp03@email.com> * Copyright (C) 1998-2002 by Tal Davidson * <http://www.gnu.org/licenses/lgpl-3.0.html> * * This file is a part of Artistic Style - an indentation and * reformatting tool for C, C++, C# and Java source files. * <http://astyle.sourceforge.net> * * Artistic Style 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. * * Artistic Style 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 Artistic Style. If not, see <http://www.gnu.org/licenses/>. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef ASLOCALIZER_H #define ASLOCALIZER_H #include <string> #include <vector> using namespace std; namespace astyle { #ifndef ASTYLE_LIB //----------------------------------------------------------------------------- // ASLocalizer class for console build. // This class encapsulates all language-dependent settings and is a // generalization of the C locale concept. //----------------------------------------------------------------------------- class Translation; class ASLocalizer { public: // functions ASLocalizer(); virtual ~ASLocalizer(); string getLanguageID() const; const Translation* getTranslationClass() const; #ifdef _WIN32 void setLanguageFromLCID(size_t lcid); #endif void setLanguageFromName(const char* langID); const char* settext(const char* textIn) const; private: // functions void setTranslationClass(); private: // variables Translation* m_translation; // pointer to a polymorphic Translation class string m_langID; // language identifier from the locale string m_subLangID; // sub language identifier, if needed string m_localeName; // name of the current locale (Linux only) size_t m_lcid; // LCID of the user locale (Windows only) }; //---------------------------------------------------------------------------- // Translation base class. //---------------------------------------------------------------------------- class Translation // This base class is inherited by the language translation classes. // Polymorphism is used to call the correct language translator. // This class contains the translation vector and settext translation method. // The language vector is built by the language sub classes. // NOTE: This class must have virtual methods for typeid() to work. // typeid() is used by AStyleTestI18n_Localizer.cpp. { public: Translation() {} virtual ~Translation() {} string convertToMultiByte(const wstring &wideStr) const; size_t getTranslationVectorSize() const; bool getWideTranslation(const string &stringIn, wstring &wideOut) const; string &translate(const string &stringIn) const; protected: void addPair(const string &english, const wstring &translated); // variables vector<pair<string, wstring> > m_translation; // translation vector }; //---------------------------------------------------------------------------- // Translation classes // One class for each language. // These classes have only a constructor which builds the language vector. //---------------------------------------------------------------------------- class ChineseSimplified : public Translation { public: ChineseSimplified(); }; class ChineseTraditional : public Translation { public: ChineseTraditional(); }; class Dutch : public Translation { public: Dutch(); }; class English : public Translation { public: English(); }; class Finnish : public Translation { public: Finnish(); }; class French : public Translation { public: French(); }; class German : public Translation { public: German(); }; class Hindi : public Translation { public: Hindi(); }; class Italian : public Translation { public: Italian(); }; class Japanese : public Translation { public: Japanese(); }; class Korean : public Translation { public: Korean(); }; class Polish : public Translation { public: Polish(); }; class Portuguese : public Translation { public: Portuguese(); }; class Russian : public Translation { public: Russian(); }; class Spanish : public Translation { public: Spanish(); }; class Swedish : public Translation { public: Swedish(); }; class Ukrainian : public Translation { public: Ukrainian(); }; #endif // ASTYLE_LIB } // namespace astyle #endif // ASLOCALIZER_H
// Created file "Lib\src\amstrmid\X64\strmiids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(AM_INTERFACESETID_Standard, 0x1a8766a0, 0x62ce, 0x11cf, 0xa5, 0xd6, 0x28, 0xdb, 0x04, 0xc1, 0x00, 0x00);
/* * SerialUI.h * * Created on: May 25, 2018 * Author: Pat Deegan * * Part of the SerialUI project. * Copyright (C) 2014-2019 Pat Deegan, https://psychogenic.com * More information on licensing and usage at * https://devicedruid.com/ * * SerialUI provides an embedded/host-side user interface, comprised of menus * consisting of * - commands (orders to take action); * - inputs (user-supplied data, as text or numeric values); * - data views (various views of evolving state); and * - sub-menus containing more of the above; * * What the host does with the data, or when commands are received * from the user, is up to the programmer implementing the body of the * various callbacks that are triggered in response. * * SerialUI is designed to provide both "raw" (low-level) access to the * functionality, through e.g. a USB serial connection, and to allow for * programatic access through the device druid client application. * * See https://devicedruid.com/ for more info. * */ #ifndef SERIALUIV3_SRC_SERIALUI_H_ #define SERIALUIV3_SRC_SERIALUI_H_ #include "includes/menuitem/items.h" #include "includes/tracked/tracked.h" #include "includes/SerialUI.h" #include "includes/SUIGlobals.h" #include "includes/SerialUIPlatform.h" #ifdef SERIALUI_BUILD_TESTS #include "includes/test/tests.h" #endif #ifdef SERIALUI_SERIALIZER_JSON_ENABLE #include "includes/settings/SerializerJson.h" #include "includes/settings/DeSerializerJson.h" #endif #ifdef SERIALUI_PLATFORM_LINUX #include "includes/platform/linux/LinuxStorageFilesystem.h" #include "includes/python/ExternalModule.h" #endif #ifdef SERIALUI_AUTHENTICATOR_ENABLE #include "includes/auth/Authenticator.h" #include "includes/auth/AuthSimple.h" #endif #endif /* SERIALUIV3_SRC_SERIALUI_H_ */
/* * MRChem, a numerical real-space code for molecular electronic structure * calculations within the self-consistent field (SCF) approximations of quantum * chemistry (Hartree-Fock and Density Functional Theory). * Copyright (C) 2021 Stig Rune Jensen, Luca Frediani, Peter Wind and contributors. * * This file is part of MRChem. * * MRChem 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. * * MRChem 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 MRChem. If not, see <https://www.gnu.org/licenses/>. * * For information on the complete list of contributors to MRChem, see: * <https://mrchem.readthedocs.io/> */ #pragma once #include "mrchem.h" #include "qmfunctions/qmfunction_fwd.h" #include "tensor/tensor_fwd.h" #include "qmoperators/one_electron/KineticOperator.h" /** @file core.h * * @brief Module for generating initial guess of hydrogen functions * * The initial_guess::core namespace provides functionality to setup an * initial guess of hydrogen eigenfunctions. */ namespace mrchem { class Nuclei; namespace initial_guess { namespace core { bool setup(OrbitalVector &Phi, double prec, const Nuclei &nucs, int zeta); void project_ao(OrbitalVector &Phi, double prec, const Nuclei &nucs, int zeta); void rotate_orbitals(OrbitalVector &Psi, double prec, ComplexMatrix &U, OrbitalVector &Phi); ComplexMatrix diagonalize(OrbitalVector &Phi, KineticOperator &T, RankZeroOperator &V); } // namespace core } // namespace initial_guess } // namespace mrchem
/* Copyright 2012-2015 Frédéric Magniette, Miguel Rubio-Roy This file is part of Pyrame. Pyrame 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. Pyrame 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 Pyrame. If not, see <http://www.gnu.org/licenses/> */ #include "tcps_acq.h" int open_acqsock(int port) { int s; int res; struct sockaddr_in servaddr; s=socket(AF_INET,SOCK_STREAM,0); if (s==-1) { printf("cant create tcps socket on port %d\n",port); perror("socket"); return -1; } bzero(&servaddr,sizeof(servaddr)); servaddr.sin_family=AF_INET; servaddr.sin_addr.s_addr=htonl(INADDR_ANY); servaddr.sin_port=htons(port); res=bind(s,(struct sockaddr *)&servaddr,sizeof(servaddr)); if (res<0) { printf("cant bind tcps socket on port %d\n",port); perror("bind"); return -1; } res=listen(s,1024); if (res<0) { printf("cant listen on tcps socket on port %d\n",port); perror("listen"); return -1; } return s; } //this function should initialize acquisition //it should allocate and fill the specific structure struct tcpsacq_workspace* init_acq(char * port,char *param2, char *param3) { //allocate and fill the workspace struct tcpsacq_workspace *ws=malloc(sizeof(struct tcpsacq_workspace)); //store the params ws->port=atoi(port); //do whatever needed to initialized ws->listen_socket=open_acqsock(ws->port); if (ws->listen_socket<0) { perror("socket"); ws->listen_socket=-1; } else printf("socket_id=%d\n",ws->listen_socket); ws->client_socket=-1; //print a message if you want printf("tcp server acquisition initialized \n"); //return the workspace return ws; } //deinit the acquisition and destroy the specific structure int deinit_acq(struct tcpsacq_workspace *ws) { //stop the acquisition if necessary stop_acq(ws); //stop the listening socket if (ws->listen_socket!=-1) close(ws->listen_socket); //destroy the specific structure free(ws); //print a message if you want printf("tcp server acquisition deinitialized\n"); //return 1 if success 0 otherwise return 1; } //this function start the acquisition int start_acq(struct tcpsacq_workspace *ws) { //print a message if you want printf("tcps_start_acq\n"); return 1; } //this function stop the acquisition* //it effectively close the socket int stop_acq(struct tcpsacq_workspace *ws) { //print a message if you want printf("tcps_stop_acq\n"); //close current connection if (ws->client_socket!=-1) close(ws->client_socket); ws->client_socket=-1; return 1; } int acquire_one_block(struct tcpsacq_workspace *ws,unsigned char *buffer,int maxsize) { int size; struct sockaddr_in cliaddr; socklen_t clilen; fd_set rset; struct timeval timeout; fd_set rfds; int res; if (ws->client_socket==-1) { //printf("accepting new client..."); FD_ZERO(&rfds); FD_SET(ws->listen_socket,&rfds); timeout.tv_sec=0; timeout.tv_usec=5000; res=select(ws->listen_socket+1,&rfds,(fd_set *)0,(fd_set *)0,&timeout); if (res>0) ws->client_socket=accept(ws->listen_socket,(struct sockaddr *)&cliaddr,&clilen); else return 0; } if (ws->client_socket!=-1) { FD_ZERO (&rset); FD_SET (ws->client_socket,&rset); timeout.tv_sec=1; timeout.tv_usec=0; //printf("go to select\n"); if (select (ws->client_socket+1,&rset,NULL,NULL,&timeout)<0) { perror("select"); return 0; } if (FD_ISSET(ws->client_socket,&rset)) { //printf("client is there : reading\n"); size=read(ws->client_socket,buffer,maxsize); if (size<=0) { perror("read"); close(ws->client_socket); ws->client_socket=-1; return 0; } else { //printf("read %d bytes\n",size); return size; } } } return 0; }
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DISASSOCIATEKMSKEYREQUEST_H #define QTAWS_DISASSOCIATEKMSKEYREQUEST_H #include "cloudwatchlogsrequest.h" namespace QtAws { namespace CloudWatchLogs { class DisassociateKmsKeyRequestPrivate; class QTAWSCLOUDWATCHLOGS_EXPORT DisassociateKmsKeyRequest : public CloudWatchLogsRequest { public: DisassociateKmsKeyRequest(const DisassociateKmsKeyRequest &other); DisassociateKmsKeyRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(DisassociateKmsKeyRequest) }; } // namespace CloudWatchLogs } // namespace QtAws #endif
// // PFSK_iOS+CPU.h // PFSystemKit // // Created by Perceval FARAMAZ on 31/05/15. // Copyright (c) 2015 faramaz. All rights reserved. // #import <Foundation/Foundation.h> #import "PFSK_iOS.h" @interface PFSystemKit(CPU) @end
/** * @file chargen.h * @brief Character generator protocol * * @section License * * Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved. * * This file is part of CycloneTCP Open. * * 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. * * @author Oryx Embedded SARL (www.oryx-embedded.com) * @version 1.7.8 **/ #ifndef _CHARGEN_H #define _CHARGEN_H //Dependencies #include "core/net.h" #include "core/socket.h" //Stack size required to run the chargen service #ifndef CHARGEN_SERVICE_STACK_SIZE #define CHARGEN_SERVICE_STACK_SIZE 600 #elif (CHARGEN_SERVICE_STACK_SIZE < 1) #error CHARGEN_SERVICE_STACK_SIZE parameter is not valid #endif //Priority at which the chargen service should run #ifndef CHARGEN_SERVICE_PRIORITY #define CHARGEN_SERVICE_PRIORITY OS_TASK_PRIORITY_NORMAL #endif //Size of the buffer for input/output operations #ifndef CHARGEN_BUFFER_SIZE #define CHARGEN_BUFFER_SIZE 1500 #elif (CHARGEN_BUFFER_SIZE < 1) #error CHARGEN_BUFFER_SIZE parameter is not valid #endif //Maximum time the TCP chargen server will wait before closing the connection #ifndef CHARGEN_TIMEOUT #define CHARGEN_TIMEOUT 20000 #elif (CHARGEN_TIMEOUT < 1) #error CHARGEN_TIMEOUT parameter is not valid #endif //Chargen service port #define CHARGEN_PORT 19 /** * @brief Chargen service context **/ typedef struct { Socket *socket; char_t buffer[CHARGEN_BUFFER_SIZE]; } ChargenServiceContext; //TCP chargen service related functions error_t tcpChargenStart(void); void tcpChargenListenerTask(void *param); void tcpChargenConnectionTask(void *param); //UDP chargen service related functions error_t udpChargenStart(void); void udpChargenTask(void *param); #endif
// Created file "Lib\src\PhotoAcquireUID\photoacquireuid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(GUID_BATTERY_PERCENTAGE_REMAINING, 0xa7ad8041, 0xb45a, 0x4cae, 0x87, 0xa3, 0xee, 0xcb, 0xb4, 0x68, 0xa9, 0xe1);
/* * Copyright (c) 2018 Particle Industries, Inc. All rights 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 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <cstdlib> namespace particle { // Abstract allocator class SimpleAllocator { public: virtual ~SimpleAllocator() = default; virtual void* alloc(size_t size) = 0; virtual void free(void* ptr) = 0; }; class Allocator: public SimpleAllocator { public: virtual void* realloc(void* ptr, size_t size) = 0; }; // Allocator interface for malloc() class HeapAllocator: public Allocator { public: virtual void* alloc(size_t size) override { return ::malloc(size); } virtual void* realloc(void* ptr, size_t size) override { return ::realloc(ptr, size); } virtual void free(void* ptr) override { ::free(ptr); } static HeapAllocator* instance() { static HeapAllocator alloc; return &alloc; } }; } // particle
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_CREATEORGANIZATIONRESPONSE_P_H #define QTAWS_CREATEORGANIZATIONRESPONSE_P_H #include "workmailresponse_p.h" namespace QtAws { namespace WorkMail { class CreateOrganizationResponse; class CreateOrganizationResponsePrivate : public WorkMailResponsePrivate { public: explicit CreateOrganizationResponsePrivate(CreateOrganizationResponse * const q); void parseCreateOrganizationResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(CreateOrganizationResponse) Q_DISABLE_COPY(CreateOrganizationResponsePrivate) }; } // namespace WorkMail } // namespace QtAws #endif
// -*- mode:c++ -*- #ifndef SME_BQUEUE_H #define SME_BQUEUE_H #include <atomic> #include <vector> #include <mutex> #include <condition_variable> #include <set> #include "sme.h" #include "queue_common.h" using std::atomic_size_t; using std::vector; //template<typename T> class BQueue { private: int size; int threads; bool* halted; SyncProcess** els; Bus** busses; State* state; //std::atomic<int>* loc; int loc; // State variables int* thread_offsets; void stop(); public: BQueue(int threads, int* iterations, bool* halted); ~BQueue(); // TODO: Accept generic iterable container of parametric type T void populate(vector<SyncProcess*> els, std::set<Bus*> busses); SyncProcess* next(int); }; struct Timed { void next(); void spinlock(); }; struct Untimed { void next(); void spinlock(); }; #endif //SME_BQUEUE_H
/**************************************************************************** ** ** Copyright (C) 2015 Cabieces Julien ** Contact: https://github.com/troopa81/Qats ** ** This file is part of Qats. ** ** Qats 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. ** ** Qats 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 Qats. If not, see <http://www.gnu.org/licenses/>. ** ****************************************************************************/ #ifndef _QSCROLLBARPROTOTYPE_ #define _QSCROLLBARPROTOTYPE_ #include <QObject> #include <QScriptable> #include <QScriptValue> #include <QScriptEngine> #include <QScrollBar> namespace qats { class QScrollBarPrototype : public QObject, public QScriptable { Q_OBJECT public: QScrollBarPrototype(QObject* parent = 0):QObject(parent){} public slots: QSize sizeHint() { QScrollBar *object = qscriptvalue_cast<QScrollBar*>(thisObject()); return object->sizeHint(); } bool event(QEvent * event) { QScrollBar *object = qscriptvalue_cast<QScrollBar*>(thisObject()); return object->event(event); } }; } Q_DECLARE_METATYPE(QScrollBar*) #endif
/* * Data Processing Center >> DPC (P is the most important) * deal with Data source from diffrent image type: * jus like .bmp,.jpeg(.jpg),gif...... * The Data Souroce must Provider such Data: * 1.ppPIXLES imageData * 2.int imageWidth * 3.int imageHeight * 4.Opearator Command * will return the dealed imageData,and imageWidth,imageHeight */ #ifndef _DPC_H_ #define _DPC_H_ #include <vector> #include <deque> #include <map> #include <stdlib.h> #include "iPixels.h" #include "DperMum.h" #include "getOpt.h" #ifdef WIN32 #include <Windows.h> #endif // _WINDOWS using namespace Imaginer::DPer; //using namespace Imaginer; namespace Imaginer { namespace DPC { enum Method { UD, LR, UR, NONE }; //boundary point's Catagory,I = Imaginer #define IBASE 0 #define IPOLE -1 #define IEDGE -2 //virtual class class dataPcer { protected: DperMum* _dp; ppPIXELS _Data; int _width; int _height; char* _OpertCmd; int _beginX; int _beginY; protected: dataPcer(ppPIXELS& data,int& width,int& height):_dp(NULL), _Data(data),_width(width),_height(height),_OpertCmd(NULL){ _beginX = _Data[0][0].getX();_beginY = _Data[0][0].getY();//矫正值 } dataPcer(DperMum* dp):_dp(dp){ //_Data = _dp->getData();_width = _dp->getWidth();_height = _dp->getHeight(); //_beginX = _Data[0][0].getX();_beginY = _Data[0][0].getY();//矫正值 initData(_dp->getData(),_dp->getWidth(),_dp->getHeight()); } virtual ~dataPcer(){printf("out the dataPcer\n");} virtual bool dealManager(OPt& opt){ return false;} public://return all Data int retnWidth(); int retnHeight(); ppPIXELS retnData(); protected: //base /** * @brief newData * new/malloc some memory to a save the image data will be deal with * @param imageData * @param W the row Create two-dimensional array * @param H the col Create two-dimensional array * @return */ bool newData(ppPIXELS& imageData,int W,int H); /** * @brief dataDup2 * Copy the imageData to tmpimageData * @param imageData source * @param tmpimageData destination * @return */ bool dataDup2(ppPIXELS& imageData,ppPIXELS& tmpimageData); /** * @brief initData * init some value ,lisk _width,_height,_beginX,_beginY * @param data * @param width * @param height * @return */ bool initData(ppPIXELS data,int width,int height); /** * @brief delData * delete/free the memory image Data after deal with * @param imageData * @param H * @return */ bool delData(ppPIXELS& imageData,int H); /** * @brief clearData * clear ppPIXELS each pixel to iColor::NCOLOR * @param imageData * @param H * @return */ bool clearData(ppPIXELS& imageData, int H,int color = iColor::WHITE); /** * @brief isEdge * test (x,y) is edge of the image or not * @param x * @param y * @return */ bool isEdge(int x,int y); /** * @brief getPix * get a point RGB value from the (x,y) * if the x,y is out range ,return empty PIXELS * get PIXELS with a point(x,y),maybe add z * @param x * @param y * @return */ PIXELS getPix(int x,int y)throw(IException); }; }//namespace DPC }//namespace Imaginer #endif // dataPcer.h :[]
/* GKSelfieTaker, copyright (C) 2007-2016 Gen Kiyooka, is distributed under the GNU Lesser General Public License (GNU LGPL). This file is part of https://github.com/genkiyooka/GKSelfieTaker GKSelfieTaker 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. GKSelfieTaker 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 GKSelfieTaker. If not, see <http://www.gnu.org/licenses/>. */ #import "RequiredFoundation.h" #import "GKGraphicsContext.h" #import "GKGeometry.h" #import "GKImage.h" #import "GKSelfieTextModel.h" #import "GKSelfieTextView.h" @interface GKSelfieTextController : NSObject<GKModelViewController,GKModelViewControllerDelegate> ARC_BEGIN_IVAR_DECL(GKSelfieTextController) ARC_IVAR_DECLAREOUTLET(id<GKModelViewControllerDelegate>,delegate); ARC_IVAR_DECLAREOUTLET(GKSelfieTextModel*,model); ARC_IVAR_DECLAREOUTLET(GKSelfieTextView*,view); ARC_IVAR_DECLAREAUTO(NSTextContainer*,textContainer); ARC_IVAR_DECLAREAUTO(NSLayoutManager*,layoutManager); ARC_END_IVAR_DECL(GKSelfieTextController) @property (ARC_PROP_OUTLET) id<GKModelViewControllerDelegate> delegate; @property (ARC_PROP_OUTLET) GKSelfieTextModel* model; @property (ARC_PROP_OUTLET) GKSelfieTextView* view; @property (assign) CGFloat startingAngle; - (GKImage*)compositingOverlayImageWithSizePoints:(GKSize)sizePoints; - (GKImage*)compositingOverlayImageWithSizePoints:(GKSize)sizePoints upsideDown:(BOOL)upsideDown; - (void)drawContext:(GKGraphicsContext*)context rect:(GKRect)rect centerNormal:(GKPoint)centerNormal; - (void)drawRect:(GKRect)rect; - (IBAction)actionControlChangeUpdatedModel:(id)sender; @end #ifdef GKInterfaceBuilder326 @interface GKSelfieTextController(IBOutletInterface) @property IBOutlet id<GKModelViewControllerDelegate> delegate; @property IBOutlet GKSelfieTextModel* outletModel; @property IBOutlet GKSelfieTextView* outletView; @end #endif /* GKInterfaceBuilder326 */
#define _XOPEN_SOURCE 700 #include <errno.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #define CHECK(x) \ do { \ if (x) { \ perror(#x); \ exit(1); \ } \ } while (0) static int seen_signal_cnt = 0; static void signal_handler(int signal) { __atomic_add_fetch(&seen_signal_cnt, 1, __ATOMIC_RELAXED); printf("signal handled: %d\n", signal); } static void ignore_signal(int sig) { sigset_t newmask; sigemptyset(&newmask); if (sig) { sigaddset(&newmask, sig); } CHECK(sigprocmask(SIG_SETMASK, &newmask, NULL) < 0); } static void set_signal_handler(int sig, void* handler) { struct sigaction act = { .sa_handler = handler, }; CHECK(sigaction(sig, &act, NULL) < 0); } static void test_sigprocmask(void) { sigset_t newmask; sigset_t oldmask; sigemptyset(&newmask); sigemptyset(&oldmask); sigaddset(&newmask, SIGKILL); sigaddset(&newmask, SIGSTOP); CHECK(sigprocmask(SIG_SETMASK, &newmask, NULL) < 0); CHECK(sigprocmask(SIG_SETMASK, NULL, &oldmask) < 0); if (sigismember(&oldmask, SIGKILL) || sigismember(&oldmask, SIGSTOP)) { printf("SIGKILL or SIGSTOP should be ignored, but is not.\n"); exit(1); } } static void clean_mask_and_pending_signals(void) { /* We should not have any pending signals other than SIGALRM. */ set_signal_handler(SIGALRM, signal_handler); /* This assumes that unblocking a signal will cause its immediate delivery. */ ignore_signal(0); __atomic_store_n(&seen_signal_cnt, 0, __ATOMIC_RELAXED); } static void test_multiple_pending(void) { ignore_signal(SIGALRM); set_signal_handler(SIGALRM, signal_handler); CHECK(kill(getpid(), SIGALRM) < 0); CHECK(kill(getpid(), SIGALRM) < 0); if (__atomic_load_n(&seen_signal_cnt, __ATOMIC_RELAXED) != 0) { printf("Handled a blocked standard signal!\n"); exit(1); } ignore_signal(0); if (__atomic_load_n(&seen_signal_cnt, __ATOMIC_RELAXED) != 1) { printf("Multiple or none instances of standard signal were queued!\n"); exit(1); } __atomic_store_n(&seen_signal_cnt, 0, __ATOMIC_RELAXED); int sig = SIGRTMIN; ignore_signal(sig); CHECK(kill(getpid(), sig) < 0); CHECK(kill(getpid(), sig) < 0); set_signal_handler(sig, signal_handler); if (__atomic_load_n(&seen_signal_cnt, __ATOMIC_RELAXED) != 0) { printf("Handled a blocked real-time signal!\n"); exit(1); } ignore_signal(0); if (__atomic_load_n(&seen_signal_cnt, __ATOMIC_RELAXED) != 2) { printf("Multiple instances of real-time signal were NOT queued!\n"); exit(1); } } static void test_fork(void) { ignore_signal(SIGALRM); set_signal_handler(SIGALRM, signal_handler); CHECK(kill(getpid(), SIGALRM) < 0); pid_t p = fork(); CHECK(p < 0); if (p == 0) { ignore_signal(0); if (__atomic_load_n(&seen_signal_cnt, __ATOMIC_RELAXED) != 0) { printf("Pending signal was inherited after fork!\n"); exit(1); } puts("Child OK"); exit(0); } set_signal_handler(SIGALRM, SIG_DFL); CHECK(waitpid(p, NULL, 0) != p); } static void test_execve_start(char* self) { ignore_signal(SIGALRM); set_signal_handler(SIGALRM, SIG_DFL); CHECK(kill(getpid(), SIGALRM) < 0); char* argv[] = {self, "cont", NULL}; CHECK(execve(self, argv, NULL)); } static void test_execve_continue(void) { set_signal_handler(SIGALRM, signal_handler); if (__atomic_load_n(&seen_signal_cnt, __ATOMIC_RELAXED) != 0) { printf("Seen an unexpected signal!\n"); exit(1); } ignore_signal(0); if (__atomic_load_n(&seen_signal_cnt, __ATOMIC_RELAXED) != 1) { printf("Pending signal was NOT preserved across execve!\n"); exit(1); } } int main(int argc, char* argv[]) { if (argc < 1) { return 1; } else if (argc > 1) { test_execve_continue(); puts("All tests OK"); return 0; } test_sigprocmask(); clean_mask_and_pending_signals(); test_multiple_pending(); clean_mask_and_pending_signals(); test_fork(); clean_mask_and_pending_signals(); test_execve_start(argv[0]); return 1; }
/* crypto/evp/p_seal.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * 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 copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include <stdio.h> #include "cryptlib.h" #include <openssl/rand.h> #ifndef OPENSSL_NO_RSA # include <openssl/rsa.h> #endif #include <openssl/evp.h> #include <openssl/objects.h> #include <openssl/x509.h> int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk) { unsigned char key[EVP_MAX_KEY_LENGTH]; int i; if (type) { EVP_CIPHER_CTX_init(ctx); if (!EVP_EncryptInit_ex(ctx, type, NULL, NULL, NULL)) return 0; } if ((npubk <= 0) || !pubk) return 1; if (EVP_CIPHER_CTX_rand_key(ctx, key) <= 0) return 0; if (EVP_CIPHER_CTX_iv_length(ctx) && RAND_bytes(iv, EVP_CIPHER_CTX_iv_length(ctx)) <= 0) return 0; if (!EVP_EncryptInit_ex(ctx, NULL, NULL, key, iv)) return 0; for (i = 0; i < npubk; i++) { ekl[i] = EVP_PKEY_encrypt_old(ek[i], key, EVP_CIPHER_CTX_key_length(ctx), pubk[i]); if (ekl[i] <= 0) return (-1); } return (npubk); } /*- MACRO void EVP_SealUpdate(ctx,out,outl,in,inl) EVP_CIPHER_CTX *ctx; unsigned char *out; int *outl; unsigned char *in; int inl; { EVP_EncryptUpdate(ctx,out,outl,in,inl); } */ int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) { int i; i = EVP_EncryptFinal_ex(ctx, out, outl); if (i) i = EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, NULL); return i; }
#define X264_BIT_DEPTH 8 #define X264_GPL 1 #define X264_INTERLACED 1 #define X264_CHROMA_FORMAT 0 #define X264_VERSION "" #define X264_POINTVER "0.140.x"
/* Test file for mpfr_log1p. Copyright 2001-2017 Free Software Foundation, Inc. Contributed by the AriC and Caramba projects, INRIA. This file is part of the GNU MPFR Library. The GNU MPFR 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 3 of the License, or (at your option) any later version. The GNU MPFR 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 MPFR Library; see the file COPYING.LESSER. If not, see http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mpfr-test.h" #ifdef CHECK_EXTERNAL static int test_log1p (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) { int res; int ok = rnd_mode == MPFR_RNDN && mpfr_number_p (b) && mpfr_get_prec (a)>=53; if (ok) { mpfr_print_raw (b); } res = mpfr_log1p (a, b, rnd_mode); if (ok) { printf (" "); mpfr_print_raw (a); printf ("\n"); } return res; } #else #define test_log1p mpfr_log1p #endif #define TEST_FUNCTION test_log1p #define TEST_RANDOM_EMAX 80 #include "tgeneric.c" static void special (void) { mpfr_t x; int inex; mpfr_init (x); mpfr_set_nan (x); mpfr_clear_flags (); inex = test_log1p (x, x, MPFR_RNDN); MPFR_ASSERTN (mpfr_nan_p (x) && inex == 0); MPFR_ASSERTN (__gmpfr_flags == MPFR_FLAGS_NAN); mpfr_set_inf (x, -1); mpfr_clear_flags (); inex = test_log1p (x, x, MPFR_RNDN); MPFR_ASSERTN (mpfr_nan_p (x) && inex == 0); MPFR_ASSERTN (__gmpfr_flags == MPFR_FLAGS_NAN); mpfr_set_inf (x, 1); mpfr_clear_flags (); inex = test_log1p (x, x, MPFR_RNDN); MPFR_ASSERTN (mpfr_inf_p (x) && mpfr_sgn (x) > 0 && inex == 0); MPFR_ASSERTN (__gmpfr_flags == 0); mpfr_set_ui (x, 0, MPFR_RNDN); mpfr_clear_flags (); inex = test_log1p (x, x, MPFR_RNDN); MPFR_ASSERTN (mpfr_cmp_ui (x, 0) == 0 && MPFR_IS_POS (x) && inex == 0); MPFR_ASSERTN (__gmpfr_flags == 0); mpfr_neg (x, x, MPFR_RNDN); mpfr_clear_flags (); inex = test_log1p (x, x, MPFR_RNDN); MPFR_ASSERTN (mpfr_cmp_ui (x, 0) == 0 && MPFR_IS_NEG (x) && inex == 0); MPFR_ASSERTN (__gmpfr_flags == 0); mpfr_set_si (x, -1, MPFR_RNDN); mpfr_clear_flags (); inex = test_log1p (x, x, MPFR_RNDN); MPFR_ASSERTN (mpfr_inf_p (x) && mpfr_sgn (x) < 0 && inex == 0); MPFR_ASSERTN (__gmpfr_flags == MPFR_FLAGS_DIVBY0); mpfr_set_si (x, -2, MPFR_RNDN); mpfr_clear_flags (); inex = test_log1p (x, x, MPFR_RNDN); MPFR_ASSERTN (mpfr_nan_p (x) && inex == 0); MPFR_ASSERTN (__gmpfr_flags == MPFR_FLAGS_NAN); mpfr_clear (x); } static void other (void) { mpfr_t x, y; /* Bug reported by Guillaume Melquiond on 2006-08-14. */ mpfr_init2 (x, 53); mpfr_set_str (x, "-1.5e4f72873ed9a@-100", 16, MPFR_RNDN); mpfr_init2 (y, 57); mpfr_log1p (y, x, MPFR_RNDU); if (mpfr_cmp (x, y) != 0) { printf ("Error in tlog1p for x = "); mpfr_out_str (stdout, 16, 0, x, MPFR_RNDN); printf (", rnd = MPFR_RNDU\nExpected "); mpfr_out_str (stdout, 16, 15, x, MPFR_RNDN); printf ("\nGot "); mpfr_out_str (stdout, 16, 15, y, MPFR_RNDN); printf ("\n"); exit (1); } mpfr_clear (y); mpfr_clear (x); return; } int main (int argc, char *argv[]) { tests_start_mpfr (); special (); other (); test_generic (MPFR_PREC_MIN, 100, 50); data_check ("data/log1p", mpfr_log1p, "mpfr_log1p"); bad_cases (mpfr_log1p, mpfr_expm1, "mpfr_log1p", 256, -64, 40, 4, 128, 800, 40); tests_end_mpfr (); return 0; }
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Users/krasnocka/Downloads/j2objc-master/guava/sources/com/google/common/collect/EmptyImmutableSet.java // #include "J2ObjC_header.h" #if !ComGoogleCommonCollectEmptyImmutableSet_RESTRICT #define ComGoogleCommonCollectEmptyImmutableSet_INCLUDE_ALL 1 #endif #undef ComGoogleCommonCollectEmptyImmutableSet_RESTRICT #if !defined (_ComGoogleCommonCollectEmptyImmutableSet_) && (ComGoogleCommonCollectEmptyImmutableSet_INCLUDE_ALL || ComGoogleCommonCollectEmptyImmutableSet_INCLUDE) #define _ComGoogleCommonCollectEmptyImmutableSet_ @class ComGoogleCommonCollectImmutableList; @class ComGoogleCommonCollectUnmodifiableIterator; @class IOSObjectArray; @protocol JavaUtilCollection; #define ComGoogleCommonCollectImmutableSet_RESTRICT 1 #define ComGoogleCommonCollectImmutableSet_INCLUDE 1 #include "com/google/common/collect/ImmutableSet.h" #define ComGoogleCommonCollectEmptyImmutableSet_serialVersionUID 0LL @interface ComGoogleCommonCollectEmptyImmutableSet : ComGoogleCommonCollectImmutableSet { } - (jint)size; - (jboolean)isEmpty; - (jboolean)containsWithId:(id)target; - (jboolean)containsAllWithJavaUtilCollection:(id<JavaUtilCollection>)targets; - (ComGoogleCommonCollectUnmodifiableIterator *)iterator; - (jboolean)isPartialView; - (IOSObjectArray *)toArray; - (IOSObjectArray *)toArrayWithNSObjectArray:(IOSObjectArray *)a; - (ComGoogleCommonCollectImmutableList *)asList; - (jboolean)isEqual:(id)object; - (NSUInteger)hash; - (jboolean)isHashCodeFast; - (NSString *)description; - (id)readResolve; @end FOUNDATION_EXPORT BOOL ComGoogleCommonCollectEmptyImmutableSet_initialized; J2OBJC_STATIC_INIT(ComGoogleCommonCollectEmptyImmutableSet) CF_EXTERN_C_BEGIN FOUNDATION_EXPORT ComGoogleCommonCollectEmptyImmutableSet *ComGoogleCommonCollectEmptyImmutableSet_INSTANCE_; J2OBJC_STATIC_FIELD_GETTER(ComGoogleCommonCollectEmptyImmutableSet, INSTANCE_, ComGoogleCommonCollectEmptyImmutableSet *) J2OBJC_STATIC_FIELD_GETTER(ComGoogleCommonCollectEmptyImmutableSet, serialVersionUID, jlong) CF_EXTERN_C_END #endif J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCollectEmptyImmutableSet)
#pragma once #include <QDialog> #include "ui_ProgressDlg.h" #include <QTimer> #include <QTime> class ProgressDlg : public QDialog { Q_OBJECT public: ProgressDlg(QWidget *parent = 0); ~ProgressDlg(); protected: void closeEvent(QCloseEvent *); void reject(); public slots: void onProgressChange(bool isFinish, int openCount, int totalCount); signals: void abort(); private: Ui::ProgressDlg ui; };
#if !defined(AFX_STDAFX_H__8DA4421F_4D2A_40D7_AFF7_5459BA442D1C__INCLUDED_) #define AFX_STDAFX_H__8DA4421F_4D2A_40D7_AFF7_5459BA442D1C__INCLUDED_ #ifndef WINVER #define WINVER 0x0500 #endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0500 #endif #ifndef _WIN32_WINDOWS #define _WIN32_WINDOWS 0x0500 #endif #pragma warning(disable: 4018 4244 4996) #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Fügen Sie hier Ihre Header-Dateien ein #define WIN32_LEAN_AND_MEAN // Selten benutzte Teile der Windows-Header nicht einbinden #include <afxwin.h> #include <afxtempl.h> // needed for templated classes?? #include <tchar.h> #include <crtdbg.h> #include <olectl.h> #include <streams.h> #include <gdiplus.h> #include <atlbase.h> // CComPtr #include <qedit.h> // IMediaDet #include <vfw.h> // AviFile functions #endif // !defined(AFX_STDAFX_H__8DA4421F_4D2A_40D7_AFF7_5459BA442D1C__INCLUDED_)
/* ========================================================================= * This file is part of NITRO * ========================================================================= * * (C) Copyright 2004 - 2010, General Dynamics - Advanced Information Systems * * NITRO 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. * * 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, If not, * see <http://www.gnu.org/licenses/>. * */ #include <import/nitf.h> #include "nitf_FileSource.h" #include "nitf_JNI.h" /* This creates the _SetObj and _GetObj accessors */ NITF_JNI_DECLARE_OBJ(nitf_BandSource) /* * Class: nitf_FileSource * Method: construct * Signature: (Lnitf/IOInterface;JI)V */ JNIEXPORT void JNICALL Java_nitf_FileSource_construct (JNIEnv * env, jobject self, jobject interface, jlong start, jint numBytesPerPixel, jint pixelSkip) { nitf_Error error; jmethodID methodID; jclass inputClass; nitf_BandSource *fileSource = NULL; nitf_IOInterface *io = NULL; jfieldID fieldID; jclass bandSourceClass = (*env)->FindClass(env, "nitf/BandSource"); jmethodID bandSourceMethodID = (*env)->GetStaticMethodID(env, bandSourceClass, "register", "(Lnitf/BandSource;)V"); inputClass = (*env)->GetObjectClass(env, interface); methodID = (*env)->GetMethodID(env, inputClass, "getAddress", "()J"); io = (nitf_IOInterface *) (*env)->CallLongMethod(env, interface, methodID); /* mark the record as being safe from Java GC destruction */ /*_ManageObject(env, (jlong)io, JNI_FALSE);*/ if (pixelSkip <= 0) pixelSkip = 0; fileSource = nitf_IOSource_construct(io, start, numBytesPerPixel, pixelSkip, &error); if (!fileSource) { _ThrowNITFException(env, error.message); return; } _SetObj(env, self, fileSource); /* now, we must also register this type */ (*env)->CallStaticVoidMethod(env, bandSourceClass, bandSourceMethodID, self); return; } /* * Class: nitf_FileSource * Method: read * Signature: ([BI)V */ JNIEXPORT void JNICALL Java_nitf_FileSource_read (JNIEnv * env, jobject self, jbyteArray buf, jint size) { nitf_BandSource *source = _GetObj(env, self); char *byteBuf = NULL; nitf_Error error; byteBuf = (char*)(*env)->GetByteArrayElements(env, buf, NULL); if (!byteBuf) { _ThrowNITFException(env, "ERROR getting data from array"); return; } if (!source->iface->read(source->data, (char *) byteBuf, size, &error)) { _ThrowNITFException(env, error.message); return; } (*env)->ReleaseByteArrayElements(env, buf, byteBuf, 0); return; } JNIEXPORT jlong JNICALL Java_nitf_FileSource_getSize (JNIEnv *env, jobject self) { nitf_BandSource *source = _GetObj(env, self); nitf_Error error; nitf_Off size; if (0 > (size = source->iface->getSize(source->data, &error))) { _ThrowNITFException(env, error.message); return -1; } return (jlong)size; } JNIEXPORT void JNICALL Java_nitf_FileSource_setSize (JNIEnv *env, jobject self, jlong size) { nitf_BandSource *source = _GetObj(env, self); nitf_Error error; if (!source->iface->setSize(source->data, (nitf_Off)size, &error)) { _ThrowNITFException(env, error.message); return; } }
/* * non_tcp_udp.c * * Copyright (C) 2009-2011 by ipoque GmbH * Copyright (C) 2011-13 - ntop.org * * This file is part of nDPI, an open source deep packet inspection * library based on the OpenDPI and PACE technology by ipoque GmbH * * nDPI 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. * * nDPI 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 nDPI. If not, see <http://www.gnu.org/licenses/>. * */ #include "ndpi_protocols.h" #if defined(NDPI_PROTOCOL_IP_IPSEC) || defined(NDPI_PROTOCOL_IP_GRE) || defined(NDPI_PROTOCOL_IP_ICMP) || defined(NDPI_PROTOCOL_IP_IGMP) || defined(NDPI_PROTOCOL_IP_EGP) || defined(NDPI_PROTOCOL_IP_SCTP) || defined(NDPI_PROTOCOL_IP_OSPF) || defined(NDPI_PROTOCOL_IP_IP_IN_IP) #define set_protocol_and_bmask(nprot) \ { \ if (NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask,nprot) != 0) \ { \ ndpi_int_add_connection(ndpi_struct, flow, \ nprot, \ NDPI_REAL_PROTOCOL); \ } \ } void ndpi_search_in_non_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; if (packet->iph == NULL) { #ifdef NDPI_DETECTION_SUPPORT_IPV6 if (packet->iphv6 == NULL) #endif return; } switch (packet->l4_protocol) { #ifdef NDPI_PROTOCOL_IP_IPSEC case NDPI_IPSEC_PROTOCOL_ESP: case NDPI_IPSEC_PROTOCOL_AH: set_protocol_and_bmask(NDPI_PROTOCOL_IP_IPSEC); break; #endif /* NDPI_PROTOCOL_IP_IPSEC */ #ifdef NDPI_PROTOCOL_IP_GRE case NDPI_GRE_PROTOCOL_TYPE: set_protocol_and_bmask(NDPI_PROTOCOL_IP_GRE); break; #endif /* NDPI_PROTOCOL_IP_GRE */ #ifdef NDPI_PROTOCOL_IP_ICMP case NDPI_ICMP_PROTOCOL_TYPE: set_protocol_and_bmask(NDPI_PROTOCOL_IP_ICMP); break; #endif /* NDPI_PROTOCOL_IP_ICMP */ #ifdef NDPI_PROTOCOL_IP_IGMP case NDPI_IGMP_PROTOCOL_TYPE: set_protocol_and_bmask(NDPI_PROTOCOL_IP_IGMP); break; #endif /* NDPI_PROTOCOL_IP_IGMP */ #ifdef NDPI_PROTOCOL_IP_EGP case NDPI_EGP_PROTOCOL_TYPE: set_protocol_and_bmask(NDPI_PROTOCOL_IP_EGP); break; #endif /* NDPI_PROTOCOL_IP_EGP */ #ifdef NDPI_PROTOCOL_IP_SCTP case NDPI_SCTP_PROTOCOL_TYPE: set_protocol_and_bmask(NDPI_PROTOCOL_IP_SCTP); break; #endif /* NDPI_PROTOCOL_IP_SCTP */ #ifdef NDPI_PROTOCOL_IP_OSPF case NDPI_OSPF_PROTOCOL_TYPE: set_protocol_and_bmask(NDPI_PROTOCOL_IP_OSPF); break; #endif /* NDPI_PROTOCOL_IP_OSPF */ #ifdef NDPI_PROTOCOL_IP_IP_IN_IP case NDPI_IPIP_PROTOCOL_TYPE: set_protocol_and_bmask(NDPI_PROTOCOL_IP_IP_IN_IP); break; #endif /* NDPI_PROTOCOL_IP_IP_IN_IP */ #ifdef NDPI_PROTOCOL_IP_ICMPV6 case NDPI_ICMPV6_PROTOCOL_TYPE: set_protocol_and_bmask(NDPI_PROTOCOL_IP_ICMPV6); break; #endif /* NDPI_PROTOCOL_IP_ICMPV6 */ #ifdef NDPI_PROTOCOL_IP_VRRP case 112: set_protocol_and_bmask(NDPI_PROTOCOL_IP_VRRP); break; #endif /* NDPI_PROTOCOL_IP_VRRP */ } } #endif
/* Copyright (C) 2013 <SWGEmu> This File is part of Core3. 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 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Linking Engine3 statically or dynamically with other modules is making a combined work based on Engine3. Thus, the terms and conditions of the GNU Lesser General Public License cover the whole combination. In addition, as a special exception, the copyright holders of Engine3 give you permission to combine Engine3 program with free software programs or libraries that are released under the GNU LGPL and with code included in the standard release of Core3 under the GNU LGPL license (or modified versions of such code, with unchanged license). You may copy and distribute such a system following the terms of the GNU LGPL for Engine3 and the licenses of the other code concerned, provided that you include the source code of that other code when and as the GNU LGPL requires distribution of source code. Note that people who make modified versions of Engine3 are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. */ #ifndef DROIDPOWERTASK_H_ #define DROIDPOWERTASK_H_ #include "server/zone/objects/creature/DroidObject.h" namespace server { namespace zone { namespace objects { namespace creature { namespace events { class DroidPowerTask : public Task { ManagedReference<DroidObject*> droid; public: DroidPowerTask(DroidObject* droid) : Task() { this->droid = droid; } void run() { if( droid == NULL ) return; Locker locker(droid); droid->removePendingTask("droid_power"); // Check if droid is spawned if( droid->getLocalZone() == NULL ){ // Not outdoors ManagedWeakReference<SceneObject*> parent = droid->getParent(); if( parent == NULL || !parent.get()->isCellObject() ){ // Not indoors either return; } } // Consume power if available if ( droid->hasPower() ) { droid->usePower(4); } reschedule( 120000 ); // 2 min } }; } // events } // creature } // objects } // zone } // server using namespace server::zone::objects::creature::events; #endif /*DROIDPOWERTASK_H_*/
#ifndef LINEARBINARYDNA_H #define LINEARBINARYDNA_H #include "baselineardna.h" namespace Genetic { class LinearBinaryDna : public BaseLinearDna<unsigned char> { public: void mutate(double parameter = 0.0) override; void generate(int dnaSize) override; double getDistance(BaseLinearDna <unsigned char>* dna) override; void print(); }; } void Genetic::LinearBinaryDna::mutate(double parameter) { int randomId = rand() % dna.size(); dna[randomId] = 1 - dna[randomId]; } void Genetic::LinearBinaryDna::generate(int dnaSize) { dna.resize(dnaSize); for(int i = 0; i < dna.size(); ++i) { dna[i] = rand() & 1; } } double Genetic::LinearBinaryDna::getDistance(BaseLinearDna <unsigned char>* otherDna) { double distance = 0.0; for(int i = 0; i < dna.size(); ++i) { if(dna[i] != dynamic_cast<LinearBinaryDna*>(otherDna) -> dna[i]) { distance += 1.0; } } return distance; } void Genetic::LinearBinaryDna::print() { for(int i = 0; i < dna.size(); ++i) { dnalog << static_cast<bool>(dna[i]); } dnalog << std::endl; } #endif
/* * Memory functions * * Copyright (C) 2012-2020, Joachim Metz <joachim.metz@gmail.com> * * Refer to AUTHORS for acknowledgements. * * 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 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 Lesser General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ #if !defined( _MEMORY_H ) #define _MEMORY_H #include "common.h" #if defined( HAVE_GLIB_H ) #include <glib.h> #endif #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include <stdlib.h> #endif #if defined( HAVE_STRING_H ) || defined( WINAPI ) #include <string.h> #endif #if defined( __cplusplus ) extern "C" { #endif /* Note that 128 MiB is an arbitrary selected upper limit here */ #define MEMORY_MAXIMUM_ALLOCATION_SIZE \ ( 128 * 1024 * 1024 ) /* Memory allocation */ #if defined( HAVE_GLIB_H ) #define memory_allocate( size ) \ g_malloc( (gsize) size ) #elif defined( WINAPI ) #define memory_allocate( size ) \ HeapAlloc( GetProcessHeap(), 0, (SIZE_T) size ) #elif defined( HAVE_MALLOC ) #define memory_allocate( size ) \ malloc( size ) #endif #define memory_allocate_structure( type ) \ (type *) memory_allocate( sizeof( type ) ) #define memory_allocate_structure_as_value( type ) \ (intptr_t *) memory_allocate( sizeof( type ) ) /* Memory reallocation */ #if defined( HAVE_GLIB_H ) #define memory_reallocate( buffer, size ) \ g_realloc( (gpointer) buffer, (gsize) size ) #elif defined( WINAPI ) /* HeapReAlloc does not allocate empty (NULL) buffers as realloc does */ #define memory_reallocate( buffer, size ) \ ( buffer == NULL ) ? \ HeapAlloc( GetProcessHeap(), 0, (SIZE_T) size ) : \ HeapReAlloc( GetProcessHeap(), 0, (LPVOID) buffer, (SIZE_T) size ) #elif defined( HAVE_REALLOC ) #define memory_reallocate( buffer, size ) \ realloc( (void *) buffer, size ) #endif /* Memory free */ #if defined( HAVE_GLIB_H ) #define memory_free( buffer ) \ g_free( (gpointer) buffer ) #elif defined( WINAPI ) #define memory_free( buffer ) \ ( buffer == NULL ) ? TRUE : HeapFree( GetProcessHeap(), 0, (LPVOID) buffer ) #elif defined( HAVE_FREE ) #define memory_free( buffer ) \ free( (void *) buffer ) #endif /* Memory compare */ #if defined( HAVE_MEMCMP ) || defined( WINAPI ) #define memory_compare( buffer1, buffer2, size ) \ memcmp( (const void *) buffer1, (const void *) buffer2, size ) #endif /* Memory copy */ #if defined( HAVE_MEMCPY ) || defined( WINAPI ) #define memory_copy( destination, source, count ) \ memcpy( (void *) destination, (void *) source, count ) #endif /* Memory set */ #if defined( HAVE_MEMSET ) || defined( WINAPI ) #define memory_set( buffer, value, count ) \ memset( (void *) buffer, (int) value, count ) #endif #if defined( __cplusplus ) } #endif #endif /* !defined( _MEMORY_H ) */
#ifndef TileManager_h #define TileManager_h /** This is free and unencumbered software released into the public domain. The authors of ISIS do not claim copyright on the contents of this file. For more details about the LICENSE terms and the AUTHORS, you will find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include "BufferManager.h" #include "Cube.h" namespace Isis { /** * @brief Buffer manager, for moving through a cube in tiles * * This class is used as a manager for moving through a cube one tile at a time. * A tile is defined as a two dimensional (n samples by m lines) sub area of a * cube. The band direction is always one deep. The sequence of tiles starts * with the tile containing sample one, line one and band one. It then moves * across the cube in the sample direction then to the next tile in the line * direction and finally to the next tile in the band direction. * * If you would like to see TileManager being used in implementation, * see the ProcessByTile class * * @ingroup LowLevelCubeIO * * @author 2002-10-10 Stuart Sides * * @internal * @history 2003-05-16 Stuart Sides - Modified schema from astrogeology... * isis.astrogeology... * @history 2005-02-22 Elizabeth Ribelin - Modified file to support Doxygen * documentation * * @todo 2005-05-23 Jeff Anderson - There could be problems with 2GB files if * the tile size is very small, 1x1, 2x1, 1x2. Should we worry about this? */ class TileManager : public Isis::BufferManager { private: int p_numSampTiles; //!<Stores the number of tiles in the sample direction int p_numLineTiles; //!<Stores the number of tiles in the line direction public: // Constructors and Destructors TileManager(const Isis::Cube &cube, const int &bufNumSamples = 128, const int &bufNumLines = 128); //! Destroys the TileManager object ~TileManager() {}; bool SetTile(const int Tile, const int band = 1); /** * Returns the number of Tiles in the cube. * * @return int */ inline int Tiles() { return MaxMaps(); }; }; }; #endif
/* * Defines utitlity macros. */ #include <sys/time.h> #ifdef DEBUG #define DBPRINT(str) do { printf str ; fflush(stdout);} while (0) #else #define DBPRINT(str) do {} while (0) #endif #define GET_TIME(s) do { gettimeofday(&s, NULL);} while (0) #define PRINT_TIME(start, end) \ do { \ long int diff = (end.tv_sec - start.tv_sec) * 1000;\ diff += (end.tv_usec - start.tv_usec) / 1000;\ printf("Simulations took %ld ms to complete.\n", diff);\ } while (0)
#ifndef SETOFINTS3_H_ #define SETOFINTS3_H_ #include "Error.h" #include <iostream> class SetOfInts3 { // Conjuntos de enteros representados como vectores ordenados sin repeticiones private: static const int MAXSIZE = 50; int elems[MAXSIZE]; int size; bool isFull() const; void binSearch(int x,bool& found,int& pos) const; int binSearchAux(int x, int a, int b) const; void shiftRightFrom(int i); void shiftLeftFrom(int i); public: SetOfInts3(); bool isEmpty() const; void add(int x) throw (Error); bool contains(int x) const; void remove(int x); int getSize() const; void setSize(int value) throw (Error); int getMax() const throw (Error); void removeMax(); int getMin() const throw (Error); void removeMin(); bool operator==(const SetOfInts3& set) const; bool operator<(const SetOfInts3& set) const; bool operator<=(const SetOfInts3& set) const; bool operator>(const SetOfInts3& set) const; bool operator>=(const SetOfInts3& set) const; friend istream& operator>>(istream& sIn,SetOfInts3& set); friend ostream& operator<<(ostream& sOut,SetOfInts3& set); }; #endif /* SETOFINTS3_H_ */
#ifndef NODE_H #define NODE_H #include "State.h" #include "global.h" /** * Stores a node in the search tree. * * Nodes use a simple minimax algorithm with alpha-beta pruning. The only * optimization of note: if our heuristic determines that a node has a value of * -0.5 or lower (on a scale from -1 to 1), in-depth scanning of that node is * abandoned. */ class Node { public: /** * Constructs a search node. * * @param state State at this node. * @param bool isWhite <code>true</code> if we're searching for the * value from white's perspective. */ Node(const State& state, bool isWhite); /** * Returns the worst-case maximum value of this node, using the minimax * algorithm. * * @param alpha Alpha (in alpha-beta pruning algorithm). * @param beta Beta (in alpha-beta pruning algorithm). * @param depth Depth to search within this node. */ template<class Evaluator> float getMaxValue(float alpha, float beta, int depth) const; /** * Returns the best-case minimum value of this node, using the minimax * algorithm. * * @param alpha Alpha (in alpha-beta pruning algorithm). * @param beta Beta (in alpha-beta pruning algorithm). * @param depth Depth to search within this node. */ template<class Evaluator> float getMinValue(float alpha, float beta, int depth) const; private: __pure inline float getLeafValue() const; State state; bool isWhite; }; float Node::getLeafValue() const { Piece winner = this->state.winner(); if (winner != PIECE_NONE) { if (winner == PIECE_WHITE) { return this->isWhite ? 1 : -1; } else { return this->isWhite ? -1 : 1; } } return 0; } #endif /* NODE_H */
#ifndef VERSION_H #define VERSION_H namespace AutoVersion{ //Date Version Types static const char DATE[] = "08"; static const char MONTH[] = "05"; static const char YEAR[] = "2017"; static const char UBUNTU_VERSION_STYLE[] = "17.05"; //Software Status static const char STATUS[] = "Release"; static const char STATUS_SHORT[] = "r"; //Standard Version Type static const long MAJOR = 0; static const long MINOR = 3; static const long BUILD = 8; static const long REVISION = 7; //Miscellaneous Version Types static const long BUILDS_COUNT = 2094; #define RC_FILEVERSION 0,3,8,7 #define RC_FILEVERSION_STRING "0, 3, 8, 7\0" static const char FULLVERSION_STRING [] = "0.3.8.7"; //These values are to keep track of your versioning state, don't modify them. static const long BUILD_HISTORY = 0; } #endif //VERSION_H
#include <gtk/gtk.h> int main( int argc, char *argv[]) { GtkWidget *window; GtkWidget *image; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); gtk_window_set_default_size(GTK_WINDOW(window), 230, 150); gtk_window_set_title(GTK_WINDOW(window), "Urjc"); gtk_window_set_resizable(GTK_WINDOW(window), FALSE); gtk_container_set_border_width(GTK_CONTAINER(window), 200); image = gtk_image_new_from_file("logoURJC.png"); gtk_container_add(GTK_CONTAINER(window), image); g_signal_connect_swapped(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), G_OBJECT(window)); gtk_widget_show_all(window); gtk_main(); return 0; }
// // HeaderCollectionView.h // Black-Weekend // // Created by scjy on 16/3/1. // Copyright © 2016年 练晓俊. All rights reserved. // #import <UIKit/UIKit.h> @interface HeaderCollectionView : UICollectionReusableView @end
#include "../atrshmlog_internal.h" /** All the rest of unix */ # include <unistd.h> /************************************************************/ /** * \file atrshmlogimpl_reuse_thread_buffers.c */ /** * \n Main code: * * \brief We check and push buffers from a thread on the full list with dispose on. * This is to make buffers available again. * * You need the tid f the thread. And its the module tid. * * Be sure the thread is dead. Its a race if not. consider be warned. * * test t_reuse_thread_buffers.c */ atrshmlog_ret_t atrshmlog_reuse_thread_buffers(const atrshmlog_tid_t i_tid) { ATRSHMLOGSTAT( atrshmlog_counter_reuse_thread_buffers); int found = 0; /* Ok. This is first strange. * But when i used it with a ksh hack i found a problem * with multile buffers written ... * And the reason is that a shell makes use of fork * and exec and also of the nice exit ... * So we are in the land of multiple exit calls to buffers * in diffrent processes. * This is why we only write our own buffers out. * Meaning : Our pid must match the pid of the buffer. * If we fork and exit the bufer has a diffrent pid... * So we can use this later as a trick o get info from the * parent, but for now i restrict the write to buffers * with the same pid. * As a fact the pid is set when we alloc a buffer for a real * thread to the init value from thread locals. * So it is * done in the running process for vital threads. * This means we can ignore the rest for now. */ atrshmlog_pid_t mypid = getpid(); atrshmlog_tbuff_t* tp = (atrshmlog_tbuff_t*)atomic_load(&atrshmlog_tps); while (tp) { int dispatched = atomic_load(&tp->dispatched); if (atrshmlog_thread_fence_10) atomic_thread_fence(memory_order_acquire); atrshmlog_tbuff_t* tpnext = tp->next_cleanup; // We skip broken buffers if (tp->safeguardfront != ATRSHMLOGSAFEGUARDVALUE) goto cleanit; // not our target if (tp->tid != i_tid) goto cleanit; // old process if (tp->pid != mypid) goto cleanit; // ok. we have it. // we will reuse it after this tp->dispose = 1; atrshmlog_dispatch_buffer(tp); ++found; cleanit: ; tp = tpnext; } return found; }
#ifndef test_num_h #define test_num_h extern void test_num_cols(void); extern void test_num_lines(void); extern void test_num_reset(void); #endif
/* * Copyright (C) 2014 BMW Car IT GmbH * * 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 CAPU_NONBLOCKSOCKETCHECKER_H #define CAPU_NONBLOCKSOCKETCHECKER_H #include "capu/os/Socket.h" #include "capu/util/Delegate.h" #include "capu/container/Pair.h" #include CAPU_PLATFORM_INCLUDE(NonBlockSocketChecker) namespace capu { /** * The NonBlockSocketChecker can check several sockets for incoming data with one call * using nonblocking IO */ class NonBlockSocketChecker : private capu::os::arch::NonBlockSocketChecker { public: /** * Returns the internal socket descriptor. This can be different on * Checks if data is available for read in a vector of sockets. If data is available the * callback inside the SocketInfoPair is called. With this it is possible to track * multiple connections with one process * *@param vector with SocketInfoPairs to track */ static status_t CheckSocketsForIncomingData(const vector<capu::os::SocketInfoPair>& sockets); /** * Checks if data is available for read in a vector of sockets. If data is available the * callback inside the SocketInfoPair is called. With this it is possible to track * multiple connections with one process * * @param vector with SocketInfoPairs to track * @param milliseconds to wait until the call returns if no data is available in all of the given sockets */ static status_t CheckSocketsForIncomingData(const vector<capu::os::SocketInfoPair>& sockets, uint32_t milliseconds); }; inline status_t NonBlockSocketChecker::CheckSocketsForIncomingData(const vector<capu::os::SocketInfoPair>& sockets, uint32_t milliseconds) { return capu::os::arch::NonBlockSocketChecker::CheckSocketsForIncomingData(sockets, milliseconds); } inline status_t NonBlockSocketChecker::CheckSocketsForIncomingData(const vector<capu::os::SocketInfoPair>& sockets) { return capu::os::arch::NonBlockSocketChecker::CheckSocketsForIncomingData(sockets); } } #endif // CAPU_NONBLOCKSOCKETCHECKER_H
/* * Copyright (c) 2018, NXP * * SPDX-License-Identifier: Apache-2.0 */ #include <init.h> #include <fsl_iomuxc.h> static int mimxrt1020_evk_init(struct device *dev) { ARG_UNUSED(dev); CLOCK_EnableClock(kCLOCK_Iomuxc); CLOCK_EnableClock(kCLOCK_IomuxcSnvs); /* LED */ IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_05_GPIO1_IO05, 0); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_05_GPIO1_IO05, IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); /* SW0 */ IOMUXC_SetPinMux(IOMUXC_SNVS_WAKEUP_GPIO5_IO00, 0); #ifdef CONFIG_UART_MCUX_LPUART_1 /* LPUART1 TX/RX */ IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_06_LPUART1_TX, 0); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_07_LPUART1_RX, 0); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_06_LPUART1_TX, IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_07_LPUART1_RX, IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); #endif return 0; } SYS_INIT(mimxrt1020_evk_init, PRE_KERNEL_1, 0);
#ifndef __DALI_INTERNAL_SCENE_GRAPH_SCENE_CONTROLLER_IMPL_H__ #define __DALI_INTERNAL_SCENE_GRAPH_SCENE_CONTROLLER_IMPL_H__ /* * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // INTERNAL INCLUDES #include <dali/internal/update/controllers/scene-controller.h> namespace Dali { namespace Internal { namespace SceneGraph { /** * concrete implementation of the scene controller interface */ class SceneControllerImpl: public SceneController { public: /** * Constructor * @param[in] rendererDispatcher Used for passing ownership of renderers to the render-thread. * @param[in] renderQueue The renderQueue * @param[in] discardQueue The discardQueue */ SceneControllerImpl( RenderMessageDispatcher& renderMessageDispatcher, RenderQueue& renderQueue, DiscardQueue& discardQueue ); /** * Destructor */ virtual ~SceneControllerImpl(); public: // from SceneController /** * @copydoc SceneController::GetRenderMessageDispatcher() */ virtual RenderMessageDispatcher& GetRenderMessageDispatcher() { return mRenderMessageDispatcher; } /** * @copydoc SceneController::GetRenderQueue() */ virtual RenderQueue& GetRenderQueue() { return mRenderQueue; } /** * @copydoc SceneController::GetDiscardQueue() */ virtual DiscardQueue& GetDiscardQueue() { return mDiscardQueue; } private: // Undefined copy constructor. SceneControllerImpl( const SceneControllerImpl& ); // Undefined assignment operator. SceneControllerImpl& operator=( const SceneControllerImpl& ); private: RenderMessageDispatcher& mRenderMessageDispatcher; ///< Used for passing messages to the render-thread RenderQueue& mRenderQueue; ///< render queue DiscardQueue& mDiscardQueue; ///< discard queue }; } // namespace SceneGraph } // namespace Internal } // namespace Dali #endif // __DALI_INTERNAL_SCENE_GRAPH_SCENE_CONTROLLER_IMPL_H__
/* * Copyright (C) 2017 Kovid Goyal <kovid at kovidgoyal.net> * * Distributed under terms of the Apache 2.0 license. */ #define STACK_ITEM_CLASS(name) typedef struct { Item1 gumbo; Item2 xml; } name; STACK_ITEM_CLASS(StackItemClass) #undef STACK_ITEM_CLASS #define STACK_CLASS(name) typedef struct { size_t length; size_t capacity; StackItemClass *items; } name; STACK_CLASS(StackClass) #undef STACK_CLASS #define CONC(a, b) a ## _ ## b #define EVAL(x, y) CONC(x, y) #define FNAME(x) EVAL(StackClass, x) static inline StackClass* FNAME(alloc)(size_t sz) { StackClass *ans = calloc(sizeof(StackClass), 1); if (ans) { ans->items = (StackItemClass*)malloc(sizeof(StackItemClass) * sz); if (ans->items) ans->capacity = sz; else { free(ans); ans = NULL; } } return ans; } static inline void FNAME(free)(StackClass *s) { if (s) { free(s->items); free(s); } } static inline void FNAME(pop)(StackClass *s, Item1 *g, Item2 *x) { StackItemClass *si = &(s->items[--(s->length)]); *g = si->gumbo; *x = si->xml; } #ifndef SAFE_REALLOC_DEFINED #define SAFE_REALLOC_DEFINED static inline void* safe_realloc(void *p, size_t sz) { void *orig = p; void *ans = realloc(p, sz); if (ans == NULL) free(orig); return ans; } #endif static inline bool FNAME(push)(StackClass *s, Item1 g, Item2 x) { if (s->length >= s->capacity) { s->capacity *= 2; s->items = (StackItemClass*)safe_realloc(s->items, s->capacity * sizeof(StackItemClass)); if (!s->items) return false; } StackItemClass *si = &(s->items[(s->length)++]); si->gumbo = g; si->xml = x; return true; } #undef EVAL #undef CONC #undef FNAME
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/chime-sdk-meetings/ChimeSDKMeetings_EXPORTS.h> #include <aws/chime-sdk-meetings/model/MeetingFeatureStatus.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ChimeSDKMeetings { namespace Model { /** * <p>An optional category of meeting features that contains audio-specific * configurations, such as operating parameters for Amazon Voice Focus. * </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/chime-sdk-meetings-2021-07-15/AudioFeatures">AWS * API Reference</a></p> */ class AWS_CHIMESDKMEETINGS_API AudioFeatures { public: AudioFeatures(); AudioFeatures(Aws::Utils::Json::JsonView jsonValue); AudioFeatures& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>Makes echo reduction available to clients who connect to the meeting.</p> */ inline const MeetingFeatureStatus& GetEchoReduction() const{ return m_echoReduction; } /** * <p>Makes echo reduction available to clients who connect to the meeting.</p> */ inline bool EchoReductionHasBeenSet() const { return m_echoReductionHasBeenSet; } /** * <p>Makes echo reduction available to clients who connect to the meeting.</p> */ inline void SetEchoReduction(const MeetingFeatureStatus& value) { m_echoReductionHasBeenSet = true; m_echoReduction = value; } /** * <p>Makes echo reduction available to clients who connect to the meeting.</p> */ inline void SetEchoReduction(MeetingFeatureStatus&& value) { m_echoReductionHasBeenSet = true; m_echoReduction = std::move(value); } /** * <p>Makes echo reduction available to clients who connect to the meeting.</p> */ inline AudioFeatures& WithEchoReduction(const MeetingFeatureStatus& value) { SetEchoReduction(value); return *this;} /** * <p>Makes echo reduction available to clients who connect to the meeting.</p> */ inline AudioFeatures& WithEchoReduction(MeetingFeatureStatus&& value) { SetEchoReduction(std::move(value)); return *this;} private: MeetingFeatureStatus m_echoReduction; bool m_echoReductionHasBeenSet; }; } // namespace Model } // namespace ChimeSDKMeetings } // namespace Aws
/** * \file timing.h * * \brief Portable interface to the CPU cycle counter * * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file is part of mbed TLS (https://tls.mbed.org) */ #ifndef MBEDTLS_TIMING_F_H #define MBEDTLS_TIMING_F_H #if !defined(MBEDTLS_CONFIG_FILE) #include "config.h" #else #include MBEDTLS_CONFIG_FILE #endif #if !defined(MBEDTLS_TIMING_ALT) // Regular implementation // #include "mbedtls/timing_v.h" #include <stdint.h> #ifdef __cplusplus extern "C" { #endif /** * \brief Return the CPU cycle counter value * * \warning This is only a best effort! Do not rely on this! * In particular, it is known to be unreliable on virtual * machines. */ unsigned long mbedtls_timing_hardclock( void ); /** * \brief Return the elapsed time in milliseconds * * \param val points to a timer structure * \param reset if set to 1, the timer is restarted */ unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset ); /** * \brief Setup an alarm clock * * \param seconds delay before the "mbedtls_timing_alarmed" flag is set * * \warning Only one alarm at a time is supported. In a threaded * context, this means one for the whole process, not one per * thread. */ void mbedtls_set_alarm( int seconds ); /** * \brief Set a pair of delays to watch * (See \c mbedtls_timing_get_delay().) * * \param data Pointer to timing data * Must point to a valid \c mbedtls_timing_delay_context struct. * \param int_ms First (intermediate) delay in milliseconds. * \param fin_ms Second (final) delay in milliseconds. * Pass 0 to cancel the current delay. */ void mbedtls_timing_set_delay( void *data, uint32_t int_ms, uint32_t fin_ms ); /** * \brief Get the status of delays * (Memory helper: number of delays passed.) * * \param data Pointer to timing data * Must point to a valid \c mbedtls_timing_delay_context struct. * * \return -1 if cancelled (fin_ms = 0) * 0 if none of the delays are passed, * 1 if only the intermediate delay is passed, * 2 if the final delay is passed. */ int mbedtls_timing_get_delay( void *data ); #ifdef __cplusplus } #endif #else /* MBEDTLS_TIMING_ALT */ #include "timing_alt.h" #endif /* MBEDTLS_TIMING_ALT */ #ifdef __cplusplus extern "C" { #endif #if defined(MBEDTLS_SELF_TEST) /** * \brief Checkup routine * * \return 0 if successful, or 1 if a test failed */ int mbedtls_timing_self_test( int verbose ); #endif #ifdef __cplusplus } #endif #endif /* timing.h */
// SPRtoBMP.h : main header file for the PROJECT_NAME application // #pragma once #ifndef __AFXWIN_H__ #error "include 'stdafx.h' before including this file for PCH" #endif #include "resource.h" // main symbols // CSPRtoBMPApp: // See SPRtoBMP.cpp for the implementation of this class // class CSPRtoBMPApp : public CWinApp { public: CSPRtoBMPApp(); // Overrides public: virtual BOOL InitInstance(); // Implementation DECLARE_MESSAGE_MAP() }; extern CSPRtoBMPApp theApp;
/** * \file Comparers.h * \brief Модуль содержащий методы для сравнения чисел с заданной точностью * \author kan <kansoftware.ru> * \since 2015-08-25 * \date 2020-02-28 */ #ifndef COMPARERS_H #define COMPARERS_H constexpr double gAbsoluteZero = 0.000000001;/*!< 0.000001 Числовное представление "маленького" значения */ /** * \brief Проверяемое число, чуток, но больше чем 0 */ template< typename TData > constexpr bool isPositiveValue( const TData A, const double aAbsoluteZero = gAbsoluteZero ) { return ( A > aAbsoluteZero ); } /** * \brief A > B */ template< typename TData > constexpr bool IsGreat( const TData A, const TData B, const double aAbsoluteZero = gAbsoluteZero ) { return ( A - B > aAbsoluteZero ); } /** * \brief A < B */ template< typename TData > constexpr bool IsLess( const TData A, const TData B, const double aAbsoluteZero = gAbsoluteZero ) { return ( B - A > aAbsoluteZero ); } /** * \brief Проверяемое число 0 или типа того */ template< typename TData > constexpr bool isZero( const TData A, const double aAbsoluteZero = gAbsoluteZero ) { return ( ( -aAbsoluteZero < A ) and ( A < aAbsoluteZero ) ); } /** * \brief A != B */ template< typename TData > constexpr bool IsNotEqual( const TData A, const TData B, const double aAbsoluteZero = gAbsoluteZero ) { return ( not isZero( A - B, aAbsoluteZero ) ); } /** * \brief A == B */ template< typename TData > constexpr bool IsEqual( const TData A, const TData B, const double aAbsoluteZero = gAbsoluteZero ) { return ( isZero( A - B, aAbsoluteZero ) ); } /** * \brief получить знак числа */ template< typename TData > constexpr int Sign( TData x, const double aAbsoluteZero = gAbsoluteZero ){ if( x > aAbsoluteZero ) return 1; if( x < -aAbsoluteZero ) return -1; return 0; } #endif /* COMPARERS_H */
#pragma once #include <string> #include "envoy/http/filter.h" #include "envoy/upstream/cluster_manager.h" namespace Envoy { namespace Grpc { /** * See docs/configuration/http_filters/grpc_http1_bridge_filter.rst */ class Http1BridgeFilter : public Http::StreamFilter { public: Http1BridgeFilter(Upstream::ClusterManager& cm) : cm_(cm) {} // Http::StreamFilterBase void onDestroy() override {} // Http::StreamDecoderFilter Http::FilterHeadersStatus decodeHeaders(Http::HeaderMap& headers, bool end_stream) override; Http::FilterDataStatus decodeData(Buffer::Instance&, bool) override { return Http::FilterDataStatus::Continue; } Http::FilterTrailersStatus decodeTrailers(Http::HeaderMap&) override { return Http::FilterTrailersStatus::Continue; } void setDecoderFilterCallbacks(Http::StreamDecoderFilterCallbacks& callbacks) override { decoder_callbacks_ = &callbacks; } // Http::StreamEncoderFilter Http::FilterHeadersStatus encode100ContinueHeaders(Http::HeaderMap&) override { return Http::FilterHeadersStatus::Continue; } Http::FilterHeadersStatus encodeHeaders(Http::HeaderMap& headers, bool end_stream) override; Http::FilterDataStatus encodeData(Buffer::Instance& data, bool end_stream) override; Http::FilterTrailersStatus encodeTrailers(Http::HeaderMap& trailers) override; void setEncoderFilterCallbacks(Http::StreamEncoderFilterCallbacks& callbacks) override { encoder_callbacks_ = &callbacks; } private: void chargeStat(const Http::HeaderMap& headers); void setupStatTracking(const Http::HeaderMap& headers); Upstream::ClusterManager& cm_; Http::StreamDecoderFilterCallbacks* decoder_callbacks_{}; Http::StreamEncoderFilterCallbacks* encoder_callbacks_{}; Http::HeaderMap* response_headers_{}; bool do_bridging_{}; bool do_stat_tracking_{}; Upstream::ClusterInfoConstSharedPtr cluster_; std::string grpc_service_; std::string grpc_method_; }; } // namespace Grpc } // namespace Envoy
/* This file is part of The Firekylin Operating System. * * Copyright 2016 Liuxiaofeng * * 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. */ #include <stdlib.h> #include <string.h> #include <errno.h> static char **origenv; int putenv(const char *string) { size_t len; int envc; int remove = 0; char *tmp; char **ep; char **newenv; if (!origenv) origenv = environ; if (!(tmp = strchr(string, '='))) { len = strlen(string); remove = 1; } else len = tmp - string + 1; for (envc = 0, ep = environ; *ep; ++ep) { if (*string == **ep && !memcmp(string, *ep, len)) { if (remove) { for (; ep[1]; ++ep) ep[0] = ep[1]; ep[0] = 0; return 0; } *ep = (char*) string; return 0; } ++envc; } if (tmp) { newenv = (char**) realloc(environ == origenv ? 0 : origenv, (envc + 2) * sizeof(char*)); if (!newenv) return -1; newenv[0] = (char*) string; memcpy(newenv + 1, environ, (envc + 1) * sizeof(char*)); environ = newenv; } return 0; }
/* * ModSecurity, http://www.modsecurity.org/ * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * 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 * * If any of the files related to licensing are missing or if you have any * other questions related to licensing please contact Trustwave Holdings, Inc. * directly using the email address security@modsecurity.org. * */ #include <iostream> #include <string> #include <vector> #include <list> #include <utility> #ifndef SRC_VARIABLES_URL_ENCODED_ERROR_H_ #define SRC_VARIABLES_URL_ENCODED_ERROR_H_ #include "src/variables/variable.h" namespace modsecurity { class Transaction; namespace Variables { class UrlEncodedError : public Variable { public: UrlEncodedError() : Variable("URLENCODED_ERROR") { } void evaluate(Transaction *transaction, Rule *rule, std::vector<const collection::Variable *> *l) { transaction->m_variableUrlEncodedError.evaluate(l); } }; } // namespace Variables } // namespace modsecurity #endif // SRC_VARIABLES_URL_ENCODED_ERROR_H_
// // TFLJViewController.h // YTZG // // Created by 李 恒 on 16/8/10. // Copyright © 2016年 李 恒. All rights reserved. // #import <UIKit/UIKit.h> @interface TFLJViewController : UIViewController @end
// // UIImage+HTRoundImage.h // HeartTrip // // Created by ZM on 16/10/9. // Copyright © 2016年 ZM. All rights reserved. // #import <UIKit/UIKit.h> struct HTRadius { CGFloat topLeftRadius; CGFloat topRightRadius; CGFloat bottomLeftRadius; CGFloat bottomRightRadius; }; typedef struct HTRadius HTRadius; static inline HTRadius HTRadiusMake(CGFloat topLeftRadius, CGFloat topRightRadius, CGFloat bottomLeftRadius, CGFloat bottomRightRadius) { HTRadius radius; radius.topLeftRadius = topLeftRadius; radius.topRightRadius = topRightRadius; radius.bottomLeftRadius = bottomLeftRadius; radius.bottomRightRadius = bottomRightRadius; return radius; } static inline NSString * NSStringFromHTRadius(HTRadius radius) { return [NSString stringWithFormat:@"{%.2f, %.2f, %.2f, %.2f}", radius.topLeftRadius, radius.topRightRadius, radius.bottomLeftRadius, radius.bottomRightRadius]; } @interface UIImage (HTRoundImage) - (UIImage *)HT_setRadius:(CGFloat)radius size:(CGSize)size; - (UIImage *)HT_setRadius:(CGFloat)radius size:(CGSize)size contentMode:(UIViewContentMode)contentMode; + (UIImage *)HT_setRadius:(CGFloat)radius size:(CGSize)size borderColor:(UIColor *)borderColor borderWidth:(CGFloat)borderWidth backgroundColor:(UIColor *)backgroundColor; + (UIImage *)HT_setHTRadius:(HTRadius)radius image:(UIImage *)image size:(CGSize)size borderColor:(UIColor *)borderColor borderWidth:(CGFloat)borderWidth backgroundColor:(UIColor *)backgroundColor withContentMode:(UIViewContentMode)contentMode; @end
// // WenjuanViewController.h // baotan // // Created by 闵权 on 16/1/5. // Copyright © 2016年 闵权. All rights reserved. // #import "BaseViewController.h" #import "BaseNetWorking.h" @interface WenjuanViewController : BaseViewController<UITableViewDelegate,UITableViewDataSource> @end
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/backup/Backup_EXPORTS.h> #include <aws/backup/BackupRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Http { class URI; } //namespace Http namespace Backup { namespace Model { /** */ class AWS_BACKUP_API ListProtectedResourcesRequest : public BackupRequest { public: ListProtectedResourcesRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "ListProtectedResources"; } Aws::String SerializePayload() const override; void AddQueryStringParameters(Aws::Http::URI& uri) const override; /** * <p>The next item following a partial list of returned items. For example, if a * request is made to return <code>maxResults</code> number of items, * <code>NextToken</code> allows you to return more items in your list starting at * the location pointed to by the next token.</p> */ inline const Aws::String& GetNextToken() const{ return m_nextToken; } /** * <p>The next item following a partial list of returned items. For example, if a * request is made to return <code>maxResults</code> number of items, * <code>NextToken</code> allows you to return more items in your list starting at * the location pointed to by the next token.</p> */ inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; } /** * <p>The next item following a partial list of returned items. For example, if a * request is made to return <code>maxResults</code> number of items, * <code>NextToken</code> allows you to return more items in your list starting at * the location pointed to by the next token.</p> */ inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; } /** * <p>The next item following a partial list of returned items. For example, if a * request is made to return <code>maxResults</code> number of items, * <code>NextToken</code> allows you to return more items in your list starting at * the location pointed to by the next token.</p> */ inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); } /** * <p>The next item following a partial list of returned items. For example, if a * request is made to return <code>maxResults</code> number of items, * <code>NextToken</code> allows you to return more items in your list starting at * the location pointed to by the next token.</p> */ inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); } /** * <p>The next item following a partial list of returned items. For example, if a * request is made to return <code>maxResults</code> number of items, * <code>NextToken</code> allows you to return more items in your list starting at * the location pointed to by the next token.</p> */ inline ListProtectedResourcesRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;} /** * <p>The next item following a partial list of returned items. For example, if a * request is made to return <code>maxResults</code> number of items, * <code>NextToken</code> allows you to return more items in your list starting at * the location pointed to by the next token.</p> */ inline ListProtectedResourcesRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;} /** * <p>The next item following a partial list of returned items. For example, if a * request is made to return <code>maxResults</code> number of items, * <code>NextToken</code> allows you to return more items in your list starting at * the location pointed to by the next token.</p> */ inline ListProtectedResourcesRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;} /** * <p>The maximum number of items to be returned.</p> */ inline int GetMaxResults() const{ return m_maxResults; } /** * <p>The maximum number of items to be returned.</p> */ inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; } /** * <p>The maximum number of items to be returned.</p> */ inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; } /** * <p>The maximum number of items to be returned.</p> */ inline ListProtectedResourcesRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;} private: Aws::String m_nextToken; bool m_nextTokenHasBeenSet; int m_maxResults; bool m_maxResultsHasBeenSet; }; } // namespace Model } // namespace Backup } // namespace Aws
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/networkmanager/NetworkManager_EXPORTS.h> #include <aws/networkmanager/model/GlobalNetwork.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace NetworkManager { namespace Model { class AWS_NETWORKMANAGER_API DeleteGlobalNetworkResult { public: DeleteGlobalNetworkResult(); DeleteGlobalNetworkResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); DeleteGlobalNetworkResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>Information about the global network.</p> */ inline const GlobalNetwork& GetGlobalNetwork() const{ return m_globalNetwork; } /** * <p>Information about the global network.</p> */ inline void SetGlobalNetwork(const GlobalNetwork& value) { m_globalNetwork = value; } /** * <p>Information about the global network.</p> */ inline void SetGlobalNetwork(GlobalNetwork&& value) { m_globalNetwork = std::move(value); } /** * <p>Information about the global network.</p> */ inline DeleteGlobalNetworkResult& WithGlobalNetwork(const GlobalNetwork& value) { SetGlobalNetwork(value); return *this;} /** * <p>Information about the global network.</p> */ inline DeleteGlobalNetworkResult& WithGlobalNetwork(GlobalNetwork&& value) { SetGlobalNetwork(std::move(value)); return *this;} private: GlobalNetwork m_globalNetwork; }; } // namespace Model } // namespace NetworkManager } // namespace Aws
//////////////////////////////////////////////////////////////////////////////// /// DISCLAIMER /// /// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany /// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. /// /// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Jan Steemann //////////////////////////////////////////////////////////////////////////////// #ifndef ARANGOD_AQL_FUNCTION_H #define ARANGOD_AQL_FUNCTION_H 1 #include "Basics/Common.h" #include "Aql/Functions.h" namespace arangodb { namespace aql { struct Function { enum Conversion { CONVERSION_NONE, CONVERSION_OPTIONAL, CONVERSION_REQUIRED }; Function() = delete; /// @brief create the function Function(std::string const& externalName, std::string const& internalName, char const* arguments, bool isCacheable, bool isDeterministic, bool canThrow, bool canRunOnDBServer, bool canPassArgumentsByReference, FunctionImplementation implementation = nullptr, ExecutionCondition = nullptr); /// @brief destroy the function ~Function(); /// @brief checks if the function has been deprecated inline bool isDeprecated() const { // currently there are no deprecated functions return false; } /// @brief return the number of required arguments inline std::pair<size_t, size_t> numArguments() const { return std::make_pair(minRequiredArguments, maxRequiredArguments); } /// @brief whether or not a positional argument needs to be converted from a /// collection parameter to a collection name parameter inline Conversion getArgumentConversion(size_t position) const { if (position >= conversions.size()) { return CONVERSION_NONE; } return conversions[position]; } /// @brief parse the argument list and set the minimum and maximum number of /// arguments void initializeArguments(); /// @brief function name (name used in JavaScript implementation) std::string const internalName; /// @brief function name (name visible to the end user) std::string const externalName; /// @brief function arguments char const* arguments; /// @brief whether or not the function results may be cached by the query /// cache bool const isCacheable; /// @brief whether or not the function is deterministic (i.e. its results are /// identical when called repeatedly with the same input values) bool const isDeterministic; /// @brief whether or not the function may throw a runtime exception bool const canThrow; /// @brief whether or not the function may be executed on DB servers bool const canRunOnDBServer; /// @brief whether or not the function can get its arguments passed by /// reference bool const canPassArgumentsByReference; /// @brief minimum number of required arguments size_t minRequiredArguments; /// @brief maximum number of required arguments size_t maxRequiredArguments; /// @brief C++ implementation of the function (maybe nullptr) FunctionImplementation implementation; /// @brief condition under which the C++ implementation of the function is /// executed (if returns false, the function will be executed as its /// JavaScript /// variant) ExecutionCondition condition; /// @brief function argument conversion information std::vector<Conversion> conversions; /// @brief maximum number of function arguments that can be used static size_t const MaxArguments = 65536; }; } } #endif
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/apigateway/APIGateway_EXPORTS.h> #include <aws/apigateway/APIGatewayRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace APIGateway { namespace Model { /** * <p>Requests API Gateway to get information about a <a>Stage</a> * resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/apigateway-2015-07-09/GetStageRequest">AWS * API Reference</a></p> */ class AWS_APIGATEWAY_API GetStageRequest : public APIGatewayRequest { public: GetStageRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "GetStage"; } Aws::String SerializePayload() const override; /** * <p>[Required] The string identifier of the associated <a>RestApi</a>.</p> */ inline const Aws::String& GetRestApiId() const{ return m_restApiId; } /** * <p>[Required] The string identifier of the associated <a>RestApi</a>.</p> */ inline bool RestApiIdHasBeenSet() const { return m_restApiIdHasBeenSet; } /** * <p>[Required] The string identifier of the associated <a>RestApi</a>.</p> */ inline void SetRestApiId(const Aws::String& value) { m_restApiIdHasBeenSet = true; m_restApiId = value; } /** * <p>[Required] The string identifier of the associated <a>RestApi</a>.</p> */ inline void SetRestApiId(Aws::String&& value) { m_restApiIdHasBeenSet = true; m_restApiId = std::move(value); } /** * <p>[Required] The string identifier of the associated <a>RestApi</a>.</p> */ inline void SetRestApiId(const char* value) { m_restApiIdHasBeenSet = true; m_restApiId.assign(value); } /** * <p>[Required] The string identifier of the associated <a>RestApi</a>.</p> */ inline GetStageRequest& WithRestApiId(const Aws::String& value) { SetRestApiId(value); return *this;} /** * <p>[Required] The string identifier of the associated <a>RestApi</a>.</p> */ inline GetStageRequest& WithRestApiId(Aws::String&& value) { SetRestApiId(std::move(value)); return *this;} /** * <p>[Required] The string identifier of the associated <a>RestApi</a>.</p> */ inline GetStageRequest& WithRestApiId(const char* value) { SetRestApiId(value); return *this;} /** * <p>[Required] The name of the <a>Stage</a> resource to get information * about.</p> */ inline const Aws::String& GetStageName() const{ return m_stageName; } /** * <p>[Required] The name of the <a>Stage</a> resource to get information * about.</p> */ inline bool StageNameHasBeenSet() const { return m_stageNameHasBeenSet; } /** * <p>[Required] The name of the <a>Stage</a> resource to get information * about.</p> */ inline void SetStageName(const Aws::String& value) { m_stageNameHasBeenSet = true; m_stageName = value; } /** * <p>[Required] The name of the <a>Stage</a> resource to get information * about.</p> */ inline void SetStageName(Aws::String&& value) { m_stageNameHasBeenSet = true; m_stageName = std::move(value); } /** * <p>[Required] The name of the <a>Stage</a> resource to get information * about.</p> */ inline void SetStageName(const char* value) { m_stageNameHasBeenSet = true; m_stageName.assign(value); } /** * <p>[Required] The name of the <a>Stage</a> resource to get information * about.</p> */ inline GetStageRequest& WithStageName(const Aws::String& value) { SetStageName(value); return *this;} /** * <p>[Required] The name of the <a>Stage</a> resource to get information * about.</p> */ inline GetStageRequest& WithStageName(Aws::String&& value) { SetStageName(std::move(value)); return *this;} /** * <p>[Required] The name of the <a>Stage</a> resource to get information * about.</p> */ inline GetStageRequest& WithStageName(const char* value) { SetStageName(value); return *this;} private: Aws::String m_restApiId; bool m_restApiIdHasBeenSet; Aws::String m_stageName; bool m_stageNameHasBeenSet; }; } // namespace Model } // namespace APIGateway } // namespace Aws
// // GDHome2ViewController.h // GdApp2 // // Created by Guo, Xing Hua on 4/22/14. // Copyright (c) 2014 COMICAT. All rights reserved. // #import <UIKit/UIKit.h> #import <GBInfiniteScrollView.h> #import "GDManager.h" @interface GDHome2ViewController : UIViewController <GBInfiniteScrollViewDataSource, GBInfiniteScrollViewDelegate, GDManagerDelegate, UICollectionViewDataSource, UICollectionViewDelegate> { NSDate *lastPullToRefresh; int postIdForSegue; NSString *unitIdForSegue; BOOL logoGlowing; BOOL logoGlowed; } @end
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #ifdef _MSC_VER //disable windows complaining about max template size. #pragma warning (disable : 4503) #endif // _MSC_VER #if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32) #ifdef _MSC_VER #pragma warning(disable : 4251) #endif // _MSC_VER #ifdef USE_IMPORT_EXPORT #ifdef AWS_SES_EXPORTS #define AWS_SES_API __declspec(dllexport) #else #define AWS_SES_API __declspec(dllimport) #endif /* AWS_SES_EXPORTS */ #else #define AWS_SES_API #endif // USE_IMPORT_EXPORT #else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32) #define AWS_SES_API #endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
// The new version (localhost/ref/brewEngine.h --> localhost/src/BrewEngine.h) #ifndef BREWENGINE_H #define BREWENGINE_H #include <iostream> #include <fstream> #include <string> #include <memory> #include <sys/stat.h> #include "Files.h" #include "Accounts.h" class BrewEngine: public Files, public Accounts { public: std::string calcbrewscore(std::string linkedaccountsjson); std::string cleanupquotes(std::string accountname); std::string cleanupid(std::string accountname); std::string cleanuphash(std::string accountname); std::string getperaccountname(int index, cJSON *accountstotal); double getperaccountfreespacestats(int ctr, int index, cJSON *accountstotal, double totalaccountfreespace, int totalaccountpercent); // protected: private: const std::string BE_BREWSCORE = "BS"; const std::string BE_TOTALSPACE = "TS"; const std::string BE_USEDSPACE = "US"; const std::string BE_MAXFILESIZE = "MFS"; const short BE_TOTALFREESPACENOTCALC = -1; const short BE_TOTALFREEPERCENTNOTCALC = -1; const short BE_FREESPACEPERCENTLARGEST = 999 }; #endif /* BREWENGINE_H */
// RUN: %crabllvm -O0 --crab-dom=int --crab-check=assert "%s" 2>&1 | OutputCheck %s // CHECK: ^1 Number of total warning checks$ extern int __VERIFIER_NONDET(); extern void __VERIFIER_error() __attribute__((noreturn)); extern void __CRAB_assert(int); int e=0; int s=2; // we should get e=[0,2] and s=[2,5] with thresholds or without applying widening // we should get e=[0,+oo] and s=[2,5] otherwise int main () { while (__VERIFIER_NONDET()) { if (s == 2){ if (e ==0) e=1; s = 3; } else if (s == 3){ if (e ==1) e=2; s=4; } else if (s == 4){ if (e == 3) { __VERIFIER_error(); } s=5; } } __CRAB_assert (e >= 0 && e <=3); __CRAB_assert (s >= 2 && s <=5); return 42; }
/** * FreeRDP: A Remote Desktop Protocol Implementation * RDP Codecs * * Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com> * * 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "rdp.h" #include <freerdp/codecs.h> #define TAG FREERDP_TAG("core.codecs") BOOL freerdp_client_codecs_prepare(rdpCodecs* codecs, UINT32 flags) { if ((flags & FREERDP_CODEC_INTERLEAVED) && !codecs->interleaved) { if (!(codecs->interleaved = bitmap_interleaved_context_new(FALSE))) { WLog_ERR(TAG, "Failed to create interleaved codec context"); return FALSE; } } if ((flags & FREERDP_CODEC_PLANAR) && !codecs->planar) { if (!(codecs->planar = freerdp_bitmap_planar_context_new(FALSE, 64, 64))) { WLog_ERR(TAG, "Failed to create planar bitmap codec context"); return FALSE; } } if ((flags & FREERDP_CODEC_NSCODEC) && !codecs->nsc) { if (!(codecs->nsc = nsc_context_new())) { WLog_ERR(TAG, "Failed to create nsc codec context"); return FALSE; } } if ((flags & FREERDP_CODEC_REMOTEFX) && !codecs->rfx) { if (!(codecs->rfx = rfx_context_new(FALSE))) { WLog_ERR(TAG, "Failed to create rfx codec context"); return FALSE; } } if ((flags & FREERDP_CODEC_CLEARCODEC) && !codecs->clear) { if (!(codecs->clear = clear_context_new(FALSE))) { WLog_ERR(TAG, "Failed to create clear codec context"); return FALSE; } } if (flags & FREERDP_CODEC_ALPHACODEC) { } if ((flags & FREERDP_CODEC_PROGRESSIVE) && !codecs->progressive) { if (!(codecs->progressive = progressive_context_new(FALSE))) { WLog_ERR(TAG, "Failed to create progressive codec context"); return FALSE; } } if ((flags & (FREERDP_CODEC_AVC420 | FREERDP_CODEC_AVC444)) && !codecs->h264) { if (!(codecs->h264 = h264_context_new(FALSE))) { WLog_ERR(TAG, "Failed to create h264 codec context"); return FALSE; } } return TRUE; } BOOL freerdp_client_codecs_reset(rdpCodecs* codecs, UINT32 flags, UINT32 width, UINT32 height) { BOOL rc = TRUE; if (!freerdp_client_codecs_prepare(codecs, flags)) return FALSE; if (flags & FREERDP_CODEC_INTERLEAVED) { if (codecs->interleaved) { rc &= bitmap_interleaved_context_reset(codecs->interleaved); } } if (flags & FREERDP_CODEC_PLANAR) { if (codecs->planar) { rc &= freerdp_bitmap_planar_context_reset(codecs->planar); } } if (flags & FREERDP_CODEC_NSCODEC) { if (codecs->nsc) { rc &= nsc_context_reset(codecs->nsc, width, height); } } if (flags & FREERDP_CODEC_REMOTEFX) { if (codecs->rfx) { rc &= rfx_context_reset(codecs->rfx, width, height); } } if (flags & FREERDP_CODEC_CLEARCODEC) { if (codecs->clear) { rc &= clear_context_reset(codecs->clear); } } if (flags & FREERDP_CODEC_ALPHACODEC) { } if (flags & FREERDP_CODEC_PROGRESSIVE) { if (codecs->progressive) { rc &= progressive_context_reset(codecs->progressive); } } if (flags & (FREERDP_CODEC_AVC420 | FREERDP_CODEC_AVC444)) { if (codecs->h264) { rc &= h264_context_reset(codecs->h264, width, height); } } return rc; } rdpCodecs* codecs_new(rdpContext* context) { rdpCodecs* codecs; codecs = (rdpCodecs*) calloc(1, sizeof(rdpCodecs)); if (codecs) codecs->context = context; return codecs; } void codecs_free(rdpCodecs* codecs) { if (!codecs) return; if (codecs->rfx) { rfx_context_free(codecs->rfx); codecs->rfx = NULL; } if (codecs->nsc) { nsc_context_free(codecs->nsc); codecs->nsc = NULL; } if (codecs->h264) { h264_context_free(codecs->h264); codecs->h264 = NULL; } if (codecs->clear) { clear_context_free(codecs->clear); codecs->clear = NULL; } if (codecs->progressive) { progressive_context_free(codecs->progressive); codecs->progressive = NULL; } if (codecs->planar) { freerdp_bitmap_planar_context_free(codecs->planar); codecs->planar = NULL; } if (codecs->interleaved) { bitmap_interleaved_context_free(codecs->interleaved); codecs->interleaved = NULL; } free(codecs); }
/* * Copyright 2018 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. **/ #ifndef INSTANCE_H_ #define INSTANCE_H_ #include <vector> #include "environment.h" #include "resource.h" #include "updater.h" namespace google { // Configuration object. class Configuration; // Storage for the metadata mapping. class MetadataStore; class InstanceReader { public: InstanceReader(const Configuration& config); // A Instance metadata query function. std::vector<MetadataUpdater::ResourceMetadata> MetadataQuery() const; // Gets the monitored resource of the instance the agent is running on. // Throws std::out_of_range if no instance information is available. static MonitoredResource InstanceResource(const Environment& environment) throw(std::out_of_range); private: const Configuration& config_; Environment environment_; }; class InstanceUpdater : public PollingMetadataUpdater { public: InstanceUpdater(const Configuration& config, MetadataStore* store) : reader_(config), PollingMetadataUpdater( config, store, "InstanceUpdater", config.InstanceUpdaterIntervalSeconds(), [=]() { return reader_.MetadataQuery(); }) { } private: InstanceReader reader_; }; } #endif // INSTANCE_H_