text stringlengths 4 6.14k |
|---|
/*
* Copyright 2013 Arx Libertatis Team (see the AUTHORS file)
*
* This file is part of Arx Libertatis.
*
* Original source is copyright 2010 - 2011. Alexey Tsoy.
* http://sourceforge.net/projects/interpreter11/
*
* Boost Software License - Version 1.0 - August 17th, 2003
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifdef BOOST_PP_IS_ITERATING
#define DEC_N BOOST_PP_DEC(N)
#define SUPER_T args_adapter_impl<void(BOOST_PP_ENUM_PARAMS(DEC_N, A))>
#define IMPL_T \
arg_impl<typename boost::remove_cv<typename boost::remove_reference<BOOST_PP_CAT(A,DEC_N)>::type>::type, DEC_N>
template<BOOST_PP_ENUM_PARAMS(N, typename A)>
struct args_adapter_impl<void(BOOST_PP_ENUM_PARAMS(N, A))>
#if (N > 0)
: SUPER_T
, IMPL_T
#endif //(N > 0)
{
template<typename SourceType>
explicit args_adapter_impl(SourceType& s)
#if (N > 0)
: SUPER_T(s)
, IMPL_T(construct
(s,static_cast<typename IMPL_T::BOOST_PP_CAT(BOOST_PP_CAT(arg, DEC_N), _t) const*>(0)))
#endif //(N > 0)
{
}
};
#undef DEC_N
#undef SUPER_T
template<
typename R
BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_PARAMS(N, typename A)
>
struct args_adapter_impl<R(BOOST_PP_ENUM_PARAMS(N, A))>
: args_adapter_impl<void(BOOST_PP_ENUM_PARAMS(N, A))> {
};
#endif // BOOST_PP_IS_ITERATING
|
//ETRT-RangefinderS1
//Driver for the ET-RT Sharp Distance sensor head
//Creative Robotics Ltd 2016
#include <inttypes.h>
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
const uint8_t rangefinder_ch = 0; //Analog Chanel
const uint8_t lightSensor_ch = 1; //Analog Chanel
const uint8_t LEDTorch_pin = 5;
const uint8_t rangefinderEnable_pin = 16;
static const int RANGEFINDER_MAX = 710;
#define ENABLE_RANGEFINDER 1
#define DISABLE_RANGEFINDER 0
class ETRTRangefinderS1{
public:
ETRTRangefinderS1(void) {initialise(0);}
void initialise(bool enableState);
void update(void);
int getRange() {return rangerRaw;}
int getRangeFiltered() {return rangerFilt;}
int getLight() {return lightRaw;}
int getLightFiltered() {return lightFilt;}
void setLed(int ledValue);
void LedOn() {setLed(255);}
void ledOff() {setLed(0);}
void enable() {setEnable(1);}
void disable() {setEnable(0);}
void setEnable(bool state);
bool getEnableState() {return rangefinderEnableState;}
void setRangeFilterLength(int length) { rangeFilterLength = constrain(length, 1, 10);}
void setLightFilterLength(int length) { lightFilterLength = constrain(length, 1, 10);}
private:
int rangerRaw;
int rangerFilt;
int lightRaw;
int lightFilt;
int ledIntensity;
bool rangefinderEnableState;
int rangeFilterLength;
int lightFilterLength;
}; |
#pragma once
#include "storm/storage/expressions/Expression.h"
#include "storm/storage/expressions/Variable.h"
namespace storm {
namespace pgcl {
class VariableDeclaration {
public:
VariableDeclaration(storm::expressions::Variable const& var, storm::expressions::Expression const& exp)
: variable(var), initialValue(exp)
{
// Not implemented.
}
storm::expressions::Variable const& getVariable() const {
return variable;
}
storm::expressions::Expression const& getInitialValueExpression() const {
return initialValue;
}
private:
storm::expressions::Variable variable;
storm::expressions::Expression initialValue;
};
}
}
|
#ifndef lint
static char *RCSid = "$Header: strcar.c,v 1.1 87/08/21 16:34:11 rnovak Exp $";
#endif
/*
*------------------------------------------------------------------
*
* $Source: /u3/syseng/rnovak/src/lib/RCS/strcar.c,v $
* $Revision: 1.1 $
* $Date: 87/08/21 16:34:11 $
* $State: Exp $
* $Author: rnovak $
* $Locker: $
*
*------------------------------------------------------------------
* $Log: strcar.c,v $
* Revision 1.1 87/08/21 16:34:11 rnovak
* Initial revision
*
*------------------------------------------------------------------
*/
/*
* $Header: strcar.c,v 1.1 87/08/21 16:34:11 rnovak Exp $
* $Log: strcar.c,v $
* Revision 1.1 87/08/21 16:34:11 rnovak
* Initial revision
*
* Revision 1.2 86/12/29 16:10:07 rnovak
* Handle the includes for an include directory.
*
*
* Revision 1.1 86/12/29 15:23:51 rnovak
* Initial revision
*
* Revision 1.3 86/12/29 15:10:11 rnovak
* Added a Header.
*
* Revision 1.2 86/12/29 15:03:25 rnovak
* Added a log.
*
*/
#include <boolean.h>
#include <malloc.h>
char *
strcar(string,delimit)
char * string ;
char * delimit ;
{
char * return_val ;
int length1 ;
int length2 ;
boolean found = FALSE ;
int i ;
int j ;
length1 = strlen(string) ;
length2 = strlen(delimit) ;
return_val = malloc(length1+1) ;
for (i=0;i<length1;i++) {
for (j=0;j<length2;j++) {
if (string[i] == delimit[j]) {
found = TRUE ;
}
}
if (found == TRUE) break ;
return_val[i] = string[i] ;
}
return_val[i] = EOS ;
return return_val ;
}
|
#ifndef EL__ECMASCRIPT_ECMASCRIPT_H
#define EL__ECMASCRIPT_ECMASCRIPT_H
/* This is a trivial ECMAScript driver. All your base are belong to pasky. */
/* In the future you will get DOM, a complete ECMAScript interface and free
* plasm displays for everyone. */
#include "main/module.h"
#include "util/time.h"
struct form_state;
struct form_view;
struct string;
struct terminal;
struct uri;
struct view_state;
#define get_ecmascript_enable() get_opt_bool("ecmascript.enable")
struct ecmascript_interpreter {
struct view_state *vs;
void *backend_data;
/* Nesting level of calls to backend functions. When this is
* nonzero, there are references to backend_data in the C
* stack, so it is not safe to free the data yet. */
int backend_nesting;
/* Used by document.write() */
struct string *ret;
/* The code evaluated by setTimeout() */
struct string code;
time_t exec_start;
/* This is a cross-rerenderings accumulator of
* @document.onload_snippets (see its description for juicy details).
* They enter this list as they continue to appear there, and they
* never leave it (so that we can always find from where to look for
* any new snippets in document.onload_snippets). Instead, as we
* go through the list we maintain a pointer to the last processed
* entry. */
LIST_OF(struct string_list_item) onload_snippets;
struct string_list_item *current_onload_snippet;
/* ID of the {struct document} where those onload_snippets belong to.
* It is kept at 0 until it is definitively hard-attached to a given
* final document. Then if we suddenly appear with this structure upon
* a document with a different ID, we reset the state and start with a
* fresh one (normally, that does not happen since reloading sets
* ecmascript_fragile, but it can happen i.e. when the urrent document
* is reloaded in another tab and then you just cause the current tab
* to redraw. */
unsigned int onload_snippets_cache_id;
};
/* Why is the interpreter bound to {struct view_state} instead of {struct
* document}? That's easy, because the script won't raid just inside of the
* document, but it will also want to generate pop-up boxes, adjust form
* contents (which is doc_view-specific) etc. Of course the cons are that we
* need to wait with any javascript code execution until we get bound to the
* view_state through document_view - that means we are going to re-render the
* document if it contains a <script> area full of document.write()s. And why
* not bound the interpreter to {struct document_view} then? Because it is
* reset for each rerendering, and it sucks to do all the magic to preserve the
* interpreter over the rerenderings (we tried). */
int ecmascript_check_url(unsigned char *url, unsigned char *frame);
void ecmascript_free_urls(struct module *module);
struct ecmascript_interpreter *ecmascript_get_interpreter(struct view_state*vs);
void ecmascript_put_interpreter(struct ecmascript_interpreter *interpreter);
void ecmascript_detach_form_view(struct form_view *fv);
void ecmascript_detach_form_state(struct form_state *fs);
void ecmascript_moved_form_state(struct form_state *fs);
void ecmascript_reset_state(struct view_state *vs);
void ecmascript_eval(struct ecmascript_interpreter *interpreter, struct string *code, struct string *ret);
unsigned char *ecmascript_eval_stringback(struct ecmascript_interpreter *interpreter, struct string *code);
/* Returns -1 if undefined. */
int ecmascript_eval_boolback(struct ecmascript_interpreter *interpreter, struct string *code);
/* Takes line with the syntax javascript:<ecmascript code>. Activated when user
* follows a link with this synstax. */
void ecmascript_protocol_handler(struct session *ses, struct uri *uri);
void ecmascript_timeout_dialog(struct terminal *term, int max_exec_time);
void ecmascript_set_action(unsigned char **action, unsigned char *string);
void ecmascript_set_timeout(struct ecmascript_interpreter *interpreter, unsigned char *code, int timeout);
extern struct module ecmascript_module;
#endif
|
/*!
* \file pdb_format.h
*
* \brief PDB data format interface
*
* \author B.Dudson
* \date April 2009
*
**************************************************************************
* Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu
*
* Contact: Ben Dudson, bd512@york.ac.uk
*
* This file is part of BOUT++.
*
* BOUT++ 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.
*
* BOUT++ 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 BOUT++. If not, see <http://www.gnu.org/licenses/>.
*/
class PdbFormat;
#ifndef __PDBFORMAT_H__
#define __PDBFORMAT_H__
#include "dataformat.h"
#include "pdb.h"
class PdbFormat : public DataFormat {
public:
PdbFormat();
PdbFormat(const char *name);
PdbFormat(const string &name);
~PdbFormat();
bool openr(const string &name);
bool openr(const char *name);
bool openw(const string &name, bool append=false);
bool openw(const char *name, bool append=false);
virtual bool is_valid();
void close();
const char* filename();
const vector<int> getSize(const char *var);
const vector<int> getSize(const string &var);
// Set the origin for all subsequent calls
bool setOrigin(int x = 0, int y = 0, int z = 0);
bool setRecord(int t); // negative -> latest
// Read / Write simple variables up to 3D
bool read(int *var, const char *name, int lx = 1, int ly = 0, int lz = 0);
bool read(int *var, const string &name, int lx = 1, int ly = 0, int lz = 0);
bool read(real *var, const char *name, int lx = 1, int ly = 0, int lz = 0);
bool read(real *var, const string &name, int lx = 1, int ly = 0, int lz = 0);
bool write(int *var, const char *name, int lx = 0, int ly = 0, int lz = 0);
bool write(int *var, const string &name, int lx = 0, int ly = 0, int lz = 0);
bool write(real *var, const char *name, int lx = 0, int ly = 0, int lz = 0);
bool write(real *var, const string &name, int lx = 0, int ly = 0, int lz = 0);
// Read / Write record-based variables
bool read_rec(int *var, const char *name, int lx = 1, int ly = 0, int lz = 0);
bool read_rec(int *var, const string &name, int lx = 1, int ly = 0, int lz = 0);
bool read_rec(real *var, const char *name, int lx = 1, int ly = 0, int lz = 0);
bool read_rec(real *var, const string &name, int lx = 1, int ly = 0, int lz = 0);
bool write_rec(int *var, const char *name, int lx = 0, int ly = 0, int lz = 0);
bool write_rec(int *var, const string &name, int lx = 0, int ly = 0, int lz = 0);
bool write_rec(real *var, const char *name, int lx = 0, int ly = 0, int lz = 0);
bool write_rec(real *var, const string &name, int lx = 0, int ly = 0, int lz = 0);
void setLowPrecision() { lowPrecision = true; }
private:
PDBfile *fp;
char *fname;
bool appending;
bool lowPrecision; ///< When writing, down-convert to floats
int x0, y0, z0, t0; // Data origins
int nrecs(const char *name); // Returns the number of records
};
#endif // __PDBFORMAT_H__
|
/*
craftIk - A custom Minecraft server written in C.
Copyright (C) 2012, SI Cyrusian. All Rights Reserved.
Minecraft is a trademark of Mojang AB.
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 _CTSETTING_H_
#define _CTSETTING_H_
#include "CTTypes.h"
#include "CTString.h"
enum {
CTGameModeSurvival=0,
CTGameModeCreative
};
typedef CTUByte CTGameMode;
enum {
CTDifficultyPeaceful=0,
CTDifficultyEasy,
CTDifficultyNormal,
CTDifficultyHard
};
typedef CTUByte CTDifficulty;
enum {
CTLevelTypeDefault=0,
CTLevelTypeFlat
};
typedef CTUByte CTLevelType;
CTBOOL CTSettingGetAllowFlight();
CTBOOL CTSettingGetAllowNether();
CTBOOL CTSettingGetAllowPvP();
CTDifficulty CTSettingGetDifficulty();
CTBOOL CTSettingGetEnableQuery();
CTBOOL CTSettingGetEnableRcon();
CTGameMode CTSettingGetGameMode();
CTBOOL CTSettingGetGenerateStructures();
CTString *CTSettingGetLevelName();
CTULong CTSettingGetLevelSeed();
CTLevelType CTSettingGetLevelType();
CTShort CTSettingGetMaxBuildHeight();
CTShort CTSettingGetMaxPlayerCount();
CTBOOL CTSettingGetOnlineMode();
CTString *CTSettingGetServerDescription();
CTString *CTSettingGetServerIP();
CTShort CTSettingGetServerPort();
CTBOOL CTSettingGetSpawnAnimals();
CTBOOL CTSettingGetSpawnMonsters();
CTBOOL CTSettingGetSpawnNPCs();
CTBOOL CTSettingGetUseWhiteList();
CTByte CTSettingGetViewDistance();
void CTSettingReload();
#endif
|
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
// global var
static char *str = NULL;
// linux/seq_file.h
// void * (*start) (struct seq_file *m, loff_t *pos);
// void (*stop) (struct seq_file *m, void *v);
// void * (*next) (struct seq_file *m, void *v, loff_t *pos);
// int (*show) (struct seq_file *m, void *v);
/**
* author: aran
* fuction: seq_operations -> start
*/
static void *my_seq_start(struct seq_file *m, loff_t *pos)
{
if (0 == *pos)
{
++*pos;
return (void *)1; // return anything but NULL, just for test
}
return NULL;
}
/**
* author: aran
* fuction: seq_operations -> next
*/
static void *my_seq_next(struct seq_file *m, void *v, loff_t *pos)
{
// only once, so no next
return NULL;
}
/**
* author: aran
* fuction: seq_operations -> stop
*/
static void my_seq_stop(struct seq_file *m, void *v)
{
// clean sth.
// nothing to do
}
/**
* author: aran
* fuction: seq_operations -> show
*/
static int my_seq_show(struct seq_file *m, void *v)
{
seq_printf(m, "current kernel time is %llu\n", (unsigned long long) get_jiffies_64());
seq_printf(m, "str is %s\n", str);
return 0; //!! must be 0, or will show nothing T.T
}
// global var
static struct seq_operations my_seq_fops =
{
.start = my_seq_start,
.next = my_seq_next,
.stop = my_seq_stop,
.show = my_seq_show,
};
// file_operations
// int (*open) (struct inode *, struct file *)
// ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *)
/**
* author: aran
* fuction: file_operations -> open
*/
static int proc_seq_open(struct inode *inode, struct file *file)
{
return seq_open(file, &my_seq_fops);
}
/**
* author: aran
* fuction: file_operations -> write
*/
static ssize_t proc_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *f_pos)
{
//分配临时缓冲区
char *tmp = kzalloc((count+1), GFP_KERNEL);
if (!tmp)
return -ENOMEM;
//将用户态write的字符串拷贝到内核空间
//copy_to|from_user(to,from,cnt)
if (copy_from_user(tmp, buffer, count)) {
kfree(tmp);
return -EFAULT;
}
//将str的旧空间释放,然后将tmp赋值给str
kfree(str);
str = tmp;
return count;
}
// global var
static struct file_operations proc_seq_fops =
{
.owner = THIS_MODULE,
.open = proc_seq_open,
.read = seq_read,
.write = proc_seq_write,
.llseek = seq_lseek,
.release = seq_release,
};
static int __init my_init(void)
{
struct proc_dir_entry *file;
// create "/proc/proc_seq" file
file = proc_create_data(
"jif", // name
0666, // mode
NULL, // parent dir_entry
&proc_seq_fops, // file_operations
NULL // data
);
if (NULL == file)
{
printk("Count not create /proc/jif file!\n");
return -ENOMEM;
}
return 0;
}
static void __exit my_exit(void)
{
remove_proc_entry("jif", NULL);
kfree(str);
}
module_init(my_init);
module_exit(my_exit);
MODULE_AUTHOR("aran");
MODULE_LICENSE("GPL");
|
#ifndef LINE_H
#define LINE_H
#include "Object3D.h"
class Line : public Object3D
{
int indexList;
public:
explicit Line();
explicit Line(const Line& rhs);
~Line();
virtual Object3D* copy() const;
private:
virtual void drawGeometry(void) const;
void storeList();
};
#endif // LINE_H
|
/**
******************************************************************************
* @file USB_Host/DualCore_Standalone/Src/msc_menu.c
* @author MCD Application Team
* @version V1.4.0
* @date 17-February-2017
* @brief Mass Stoarge Process
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2017 STMicroelectronics International N.V.
* All rights reserved.</center></h2>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted, provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of other
* contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
* 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
* 5. Redistribution and use of this software other than as permitted under
* this license is void and will automatically terminate your rights under
* this license.
*
* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS 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.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
uint8_t *MSC_main_menu[] =
{
(uint8_t *)" 1 - File Operations ",
(uint8_t *)" 2 - Explorer Disk ",
(uint8_t *)" 3 - Return ",
};
/* Private function prototypes -----------------------------------------------*/
extern DEMO_StateMachine demo;
/* Private functions ---------------------------------------------------------*/
/**
* @brief Manages MSC Menu Process.
* @param None
* @retval None
*/
void MSC_MenuProcess(void)
{
switch(demo.msc_state)
{
case APPLI_MSC_IDLE:
Demo_SelectItem(MSC_main_menu, 0);
demo.msc_state = APPLI_MSC_WAIT;
demo.select = 0;
break;
case APPLI_MSC_WAIT:
if(demo.select != prev_select)
{
prev_select = demo.select;
Demo_SelectItem(MSC_main_menu, demo.select & 0x7F);
/* Handle select item */
if(demo.select & 0x80)
{
demo.select &= 0x7F;
switch(demo.select)
{
case 0:
demo.msc_state = APPLI_MSC_FILE_OPERATIONS;
break;
case 1:
demo.msc_state = APPLI_MSC_EXPLORER;
break;
case 2: /* Return */
demo.state = DEMO_IDLE;
demo.select = 0;
LCD_UsrLogY("> MSC application closed.\n");
f_mount(0,0,0);
break;
default:
break;
}
}
}
break;
case APPLI_MSC_FILE_OPERATIONS:
/* Read and Write File Here */
if(Appli_HS_state == APPLICATION_HS_READY)
{
MSC_File_Operations();
}
demo.msc_state = APPLI_MSC_WAIT;
break;
case APPLI_MSC_EXPLORER:
/* Display disk content */
if(Appli_HS_state == APPLICATION_HS_READY)
{
Explore_Disk("0:/", 1);
}
demo.msc_state = APPLI_MSC_WAIT;
break;
default:
break;
}
}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
#ifndef GST_HEADER_Main_Forms_KeyfilesPanel
#define GST_HEADER_Main_Forms_KeyfilesPanel
#include "Forms.h"
#include "Main/Main.h"
namespace GostCrypt
{
class KeyfilesPanel : public KeyfilesPanelBase
{
public:
KeyfilesPanel (wxWindow* parent, shared_ptr <KeyfileList> keyfiles);
void AddKeyfile (shared_ptr <Keyfile> keyfile);
shared_ptr <KeyfileList> GetKeyfiles () const;
protected:
void OnAddFilesButtonClick (wxCommandEvent& event);
void OnAddDirectoryButtonClick (wxCommandEvent& event);
void OnAddSecurityTokenSignatureButtonClick (wxCommandEvent& event);
void OnListItemDeselected (wxListEvent& event) { UpdateButtons(); }
void OnListItemSelected (wxListEvent& event) { UpdateButtons(); }
void OnListSizeChanged (wxSizeEvent& event);
void OnRemoveButtonClick (wxCommandEvent& event);
void OnRemoveAllButtonClick (wxCommandEvent& event);
void UpdateButtons ();
};
}
#endif // GST_HEADER_Main_Forms_KeyfilesPanel
|
class RTSPServerCleanup : Thread
{
public:
RTSPServerCleanup();
~RTSPServerCleanup();
void Start(GstRTSPServer *server);
void Stop();
private:
void Run();
bool m_started;
bool m_exit;
Mutex m_mutex;
GstRTSPSessionPool *m_pool;
};
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs"
* found in "../support/ngap-r16.1.0/38413-g10.asn"
* `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps`
*/
#include "NGAP_CompletedCellsInTAI-NR-Item.h"
#include "NGAP_ProtocolExtensionContainer.h"
asn_TYPE_member_t asn_MBR_NGAP_CompletedCellsInTAI_NR_Item_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct NGAP_CompletedCellsInTAI_NR_Item, nR_CGI),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NGAP_NR_CGI,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"nR-CGI"
},
{ ATF_POINTER, 1, offsetof(struct NGAP_CompletedCellsInTAI_NR_Item, iE_Extensions),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NGAP_ProtocolExtensionContainer_7027P30,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"iE-Extensions"
},
};
static const int asn_MAP_NGAP_CompletedCellsInTAI_NR_Item_oms_1[] = { 1 };
static const ber_tlv_tag_t asn_DEF_NGAP_CompletedCellsInTAI_NR_Item_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_NGAP_CompletedCellsInTAI_NR_Item_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nR-CGI */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* iE-Extensions */
};
asn_SEQUENCE_specifics_t asn_SPC_NGAP_CompletedCellsInTAI_NR_Item_specs_1 = {
sizeof(struct NGAP_CompletedCellsInTAI_NR_Item),
offsetof(struct NGAP_CompletedCellsInTAI_NR_Item, _asn_ctx),
asn_MAP_NGAP_CompletedCellsInTAI_NR_Item_tag2el_1,
2, /* Count of tags in the map */
asn_MAP_NGAP_CompletedCellsInTAI_NR_Item_oms_1, /* Optional members */
1, 0, /* Root/Additions */
2, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_NGAP_CompletedCellsInTAI_NR_Item = {
"CompletedCellsInTAI-NR-Item",
"CompletedCellsInTAI-NR-Item",
&asn_OP_SEQUENCE,
asn_DEF_NGAP_CompletedCellsInTAI_NR_Item_tags_1,
sizeof(asn_DEF_NGAP_CompletedCellsInTAI_NR_Item_tags_1)
/sizeof(asn_DEF_NGAP_CompletedCellsInTAI_NR_Item_tags_1[0]), /* 1 */
asn_DEF_NGAP_CompletedCellsInTAI_NR_Item_tags_1, /* Same as above */
sizeof(asn_DEF_NGAP_CompletedCellsInTAI_NR_Item_tags_1)
/sizeof(asn_DEF_NGAP_CompletedCellsInTAI_NR_Item_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_NGAP_CompletedCellsInTAI_NR_Item_1,
2, /* Elements count */
&asn_SPC_NGAP_CompletedCellsInTAI_NR_Item_specs_1 /* Additional specs */
};
|
/*
* Generated by class-dump 3.1.2.
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2007 by Steve Nygard.
*/
#import "_ABCreateStringWithAddressDictionary.h"
#import "NSCoding-Protocol.h"
@class ABKSession, NSMutableArray;
@interface ABKEventLog : _ABCreateStringWithAddressDictionary <NSCoding>
{
NSMutableArray *_eventList;
ABKSession *_session;
}
- (void)setSession:(id)fp8;
- (id)session;
- (void)setEventList:(id)fp8;
- (id)eventList;
- (void).cxx_destruct;
- (void)logControlGroupTriggerEvent:(id)fp8;
- (void)logForegroundPushReceived:(id)fp8;
- (BOOL)logPushActionTrackEvent:(id)fp8 action:(id)fp12 isFromWatch:(BOOL)fp16;
- (void)logSetCustomUserAttributeArrayEvent:(id)fp8 value:(id)fp12;
- (void)logRemoveFromCustomUserAttributeArrayEvent:(id)fp8 value:(id)fp12;
- (void)logAddToCustomUserAttributeArrayEvent:(id)fp8 value:(id)fp12;
- (void)logInAppMessageImpressionWithInAppMessage:(id)fp8;
- (void)logInAppMessageButtonClickWithInAppMessage:(id)fp8 buttonId:(id)fp12;
- (void)logInAppMessageClickWithInAppMessage:(id)fp8;
- (id)proxyForJsonOfEventList;
- (void)logLocationRecordedEvent:(id)fp8;
- (void)logIncrementCustomUserAttributeEvent:(id)fp8 value:(int)fp12;
- (void)logCardImpression:(id)fp8;
- (void)logCardClick:(id)fp8;
- (void)logUserTransitionedEventForUser:(id)fp8 toUser:(id)fp12;
- (void)trackEvent:(id)fp8;
- (void)logPushNotificationCampaignReceived:(id)fp8 isFromWatch:(BOOL)fp12;
- (void)logInternalError:(id)fp8;
- (id)logPurchase:(id)fp8 inCurrency:(id)fp12 atPrice:(id)fp16 withQuantity:(unsigned int)fp20 andProperties:(id)fp24;
- (id)logPurchase:(id)fp8 inCurrency:(id)fp12 atPrice:(id)fp16 withQuantity:(unsigned int)fp20;
- (id)logCustomEvent:(id)fp8 withProperties:(id)fp12;
- (id)logCustomEvent:(id)fp8;
- (void)logInternalEventName:(id)fp8;
- (id)init;
- (id)initWithCoder:(id)fp8;
- (void)encodeWithCoder:(id)fp8;
@end
|
#ifndef QMARKER_H
#define QMARKER_H
#include "QtAddons_global.h"
#include <QPainter>
#include <QPoint>
#include <QColor>
#include <logging/logger.h>
#include "qglyphs.h"
namespace QtAddons {
class QTADDONSSHARED_EXPORT QMarker
{
kipl::logging::Logger logger;
public:
QMarker();
QMarker(ePlotGlyph g, QPointF p, QColor c, int size=10);
QMarker(const QMarker &m);
const QMarker & operator=(const QMarker &m);
// const QMarker & operator=(const QMarker &m) const;
~QMarker();
void Draw(QPainter &painter, float scale=1.0f, QPoint offset=QPoint(0,0));
const QGlyphBase * getGlyph() const {return glyph;}
QPointF getPosition() const {return position;}
QColor getColor() const {return color;}
private:
QGlyphBase *glyph;
QPointF position;
QColor color;
};
}
#endif // QMARKER_H
|
/* Copyright (C) 2018 Magnus Lång and Tuan Phong Ngo
* This benchmark is part of SWSC */
#include <assert.h>
#include <stdint.h>
#include <stdatomic.h>
#include <pthread.h>
atomic_int vars[2];
atomic_int atom_1_r1_1;
atomic_int atom_1_r4_0;
void *t0(void *arg){
label_1:;
atomic_store_explicit(&vars[0], 1, memory_order_seq_cst);
atomic_store_explicit(&vars[0], 2, memory_order_seq_cst);
int v2_r4 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
atomic_store_explicit(&vars[1], 1, memory_order_seq_cst);
return NULL;
}
void *t1(void *arg){
label_2:;
int v4_r1 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v5_r3 = v4_r1 ^ v4_r1;
int v8_r4 = atomic_load_explicit(&vars[0+v5_r3], memory_order_seq_cst);
int v15 = (v4_r1 == 1);
atomic_store_explicit(&atom_1_r1_1, v15, memory_order_seq_cst);
int v16 = (v8_r4 == 0);
atomic_store_explicit(&atom_1_r4_0, v16, memory_order_seq_cst);
return NULL;
}
int main(int argc, char *argv[]){
pthread_t thr0;
pthread_t thr1;
atomic_init(&vars[0], 0);
atomic_init(&vars[1], 0);
atomic_init(&atom_1_r1_1, 0);
atomic_init(&atom_1_r4_0, 0);
pthread_create(&thr0, NULL, t0, NULL);
pthread_create(&thr1, NULL, t1, NULL);
pthread_join(thr0, NULL);
pthread_join(thr1, NULL);
int v9 = atomic_load_explicit(&vars[0], memory_order_seq_cst);
int v10 = (v9 == 2);
int v11 = atomic_load_explicit(&atom_1_r1_1, memory_order_seq_cst);
int v12 = atomic_load_explicit(&atom_1_r4_0, memory_order_seq_cst);
int v13_conj = v11 & v12;
int v14_conj = v10 & v13_conj;
if (v14_conj == 1) assert(0);
return 0;
}
|
/*
* This file is part of Cleanflight.
*
* Cleanflight 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.
*
* Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define TARGET_BOARD_IDENTIFIER "SP4E"
#define TARGET_CONFIG
#ifndef SPRACINGF4EVO_REV
#define SPRACINGF4EVO_REV 2
#endif
#define USBD_PRODUCT_STRING "SP Racing F4 EVO"
#define LED0_PIN PA0
#define BEEPER PC15
#define BEEPER_INVERTED
#define INVERTER_PIN_UART2 PB2
#define USE_EXTI
#define MPU_INT_EXTI PC13
#define USE_MPU_DATA_READY_SIGNAL
#define ENSURE_MPU_DATA_READY_IS_LOW
#define USE_MAG_DATA_READY_SIGNAL
#define ENSURE_MAG_DATA_READY_IS_HIGH
#define GYRO
#define USE_GYRO_SPI_MPU6500
#define ACC
#define USE_ACC_SPI_MPU6500
#define ACC_MPU6500_ALIGN CW0_DEG
#define GYRO_MPU6500_ALIGN CW0_DEG
#define BARO
#define USE_BARO_BMP280
#define USE_BARO_MS5611
#define MAG
#define USE_MAG_AK8975
#define USE_MAG_HMC5883
#define USB_IO
#define USE_VCP
#define USE_UART1
#define USE_UART2
#define USE_UART3
#define USE_UART4
#define USE_UART5
#define SERIAL_PORT_COUNT 6
#define UART1_TX_PIN PA9
#define UART1_RX_PIN PA10
#define UART2_TX_PIN PA2
#define UART2_RX_PIN PA3
#define UART3_TX_PIN PB10
#define UART3_RX_PIN PB11
#define UART4_TX_PIN PC10
#define UART4_RX_PIN PC11
#define UART5_TX_PIN PC12
#define UART5_RX_PIN PD2
#define USE_ESCSERIAL
#define ESCSERIAL_TIMER_TX_PIN PA3 // (HARDARE=0,PPM)
#define USE_ESC_SENSOR
#define USE_I2C
#define USE_I2C_DEVICE_1
#define I2C_DEVICE (I2CDEV_1)
#if (SPRACINGF4EVO_REV >= 2)
#define I2C1_SCL PB8
#define I2C1_SDA PB9
#else
#define I2C1_SCL PB6
#define I2C1_SDA PB7
#endif
#define USE_SPI
#define USE_SPI_DEVICE_1 // MPU
#define USE_SPI_DEVICE_2 // SDCard
#define USE_SPI_DEVICE_3 // External
#define SPI1_NSS_PIN PA4
#define SPI1_SCK_PIN PA5
#define SPI1_MISO_PIN PA6
#define SPI1_MOSI_PIN PA7
#define SPI2_NSS_PIN PB12
#define SPI2_SCK_PIN PB13
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15
#define SPI3_NSS_PIN PA15 // NC
#define SPI3_SCK_PIN PB3 // NC
#define SPI3_MISO_PIN PB4 // NC
#define SPI3_MOSI_PIN PB5 // NC
#define VTX_RTC6705
#define VTX_RTC6705_OPTIONAL // SPI3 on an F4 EVO may be used for RTC6705 VTX control.
#define RTC6705_CS_PIN SPI3_NSS_PIN
#define RTC6705_SPI_INSTANCE SPI3
#define USE_SDCARD
#define SDCARD_DETECT_INVERTED
#define SDCARD_DETECT_PIN PC14
#define SDCARD_SPI_INSTANCE SPI2
#define SDCARD_SPI_CS_PIN SPI2_NSS_PIN
// SPI3 is on the APB1 bus whose clock runs at 84MHz. Divide to under 400kHz for init:
#define SDCARD_SPI_INITIALIZATION_CLOCK_DIVIDER 256 // 328kHz
// Divide to under 25MHz for normal operation:
#define SDCARD_SPI_FULL_SPEED_CLOCK_DIVIDER 4 // 21MHz
#define SDCARD_DMA_CHANNEL_TX DMA1_Stream4
#define SDCARD_DMA_CHANNEL_TX_COMPLETE_FLAG DMA_FLAG_TCIF4
#define SDCARD_DMA_CLK RCC_AHB1Periph_DMA1
#define SDCARD_DMA_CHANNEL DMA_Channel_0
#define MPU6500_CS_PIN SPI1_NSS_PIN
#define MPU6500_SPI_INSTANCE SPI1
#define USE_ADC
#define ADC_INSTANCE ADC1
#define ADC1_DMA_STREAM DMA2_Stream0
#define VBAT_ADC_PIN PC1
#define CURRENT_METER_ADC_PIN PC2
#define RSSI_ADC_PIN PC0
// PC4 - NC - Free for ADC12_IN14 / VTX CS
// PC5 - NC - Free for ADC12_IN15 / VTX Enable / OSD VSYNC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define OSD
#define USE_OSD_OVER_MSP_DISPLAYPORT
#define USE_MSP_CURRENT_METER
#define LED_STRIP
#define TRANSPONDER
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
#define DEFAULT_FEATURES (FEATURE_TRANSPONDER | FEATURE_RSSI_ADC | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_LED_STRIP)
#define SERIALRX_UART SERIAL_PORT_USART2
#define TELEMETRY_UART SERIAL_PORT_UART5
#define SERIALRX_PROVIDER SERIALRX_SBUS
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
#define USABLE_TIMER_CHANNEL_COUNT 16 // 4xPWM, 8xESC, 2xESC via UART3 RX/TX, 1xLED Strip, 1xIR.
#if (SPRACINGF4NEO_REV >= 2)
#define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(9))
#else
#define USE_TIM10_TIM11_FOR_MOTORS
#ifdef USE_TIM10_TIM11_FOR_MOTORS
#define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(9) | TIM_N(10) | TIM_N(11))
#else
#define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(9))
#endif
#endif
|
#include <linux/ceph/types.h>
#include <linux/module.h>
/*
* Robert Jenkin's hash function.
* http://burtleburtle.net/bob/hash/evahash.html
* This is in the public domain.
*/
#define mix(a, b, c) \
do { \
a = a - b; a = a - c; a = a ^ (c >> 13); \
b = b - c; b = b - a; b = b ^ (a << 8); \
c = c - a; c = c - b; c = c ^ (b >> 13); \
a = a - b; a = a - c; a = a ^ (c >> 12); \
b = b - c; b = b - a; b = b ^ (a << 16); \
c = c - a; c = c - b; c = c ^ (b >> 5); \
a = a - b; a = a - c; a = a ^ (c >> 3); \
b = b - c; b = b - a; b = b ^ (a << 10); \
c = c - a; c = c - b; c = c ^ (b >> 15); \
} while (0)
unsigned int ceph_str_hash_rjenkins(const char *str, unsigned int length)
{
const unsigned char *k = (const unsigned char *)str;
__u32 a, b, c; /* the internal state */
__u32 len; /* how many key bytes still need mixing */
/* Set up the internal state */
len = length;
a = 0x9e3779b9; /* the golden ratio; an arbitrary value */
b = a;
c = 0; /* variable initialization of internal state */
/* handle most of the key */
while (len >= 12)
{
a = a + (k[0] + ((__u32)k[1] << 8) + ((__u32)k[2] << 16) +
((__u32)k[3] << 24));
b = b + (k[4] + ((__u32)k[5] << 8) + ((__u32)k[6] << 16) +
((__u32)k[7] << 24));
c = c + (k[8] + ((__u32)k[9] << 8) + ((__u32)k[10] << 16) +
((__u32)k[11] << 24));
mix(a, b, c);
k = k + 12;
len = len - 12;
}
/* handle the last 11 bytes */
c = c + length;
switch (len) /* all the case statements fall through */
{
case 11:
c = c + ((__u32)k[10] << 24);
case 10:
c = c + ((__u32)k[9] << 16);
case 9:
c = c + ((__u32)k[8] << 8);
/* the first byte of c is reserved for the length */
case 8:
b = b + ((__u32)k[7] << 24);
case 7:
b = b + ((__u32)k[6] << 16);
case 6:
b = b + ((__u32)k[5] << 8);
case 5:
b = b + k[4];
case 4:
a = a + ((__u32)k[3] << 24);
case 3:
a = a + ((__u32)k[2] << 16);
case 2:
a = a + ((__u32)k[1] << 8);
case 1:
a = a + k[0];
/* case 0: nothing left to add */
}
mix(a, b, c);
return c;
}
/*
* linux dcache hash
*/
unsigned int ceph_str_hash_linux(const char *str, unsigned int length)
{
unsigned long hash = 0;
unsigned char c;
while (length--)
{
c = *str++;
hash = (hash + (c << 4) + (c >> 4)) * 11;
}
return hash;
}
unsigned int ceph_str_hash(int type, const char *s, unsigned int len)
{
switch (type)
{
case CEPH_STR_HASH_LINUX:
return ceph_str_hash_linux(s, len);
case CEPH_STR_HASH_RJENKINS:
return ceph_str_hash_rjenkins(s, len);
default:
return -1;
}
}
EXPORT_SYMBOL(ceph_str_hash);
const char *ceph_str_hash_name(int type)
{
switch (type)
{
case CEPH_STR_HASH_LINUX:
return "linux";
case CEPH_STR_HASH_RJENKINS:
return "rjenkins";
default:
return "unknown";
}
}
EXPORT_SYMBOL(ceph_str_hash_name);
|
/* pgmbentley.c - read a portable graymap and smear it according to brightness
**
** Copyright (C) 1990 by Wilson Bent (whb@hoh-2.att.com)
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for any purpose and without fee is hereby granted, provided
** that the above copyright notice appear in all copies and that both that
** copyright notice and this permission notice appear in supporting
** documentation. This software is provided "as is" without express or
** implied warranty.
*/
#include <stdio.h>
#include "pm_c_util.h"
#include "pgm.h"
static unsigned int const N = 4;
int
main(int argc, const char * argv[]) {
FILE * ifP;
int rows, cols;
gray maxval;
gray ** gin;
gray ** gout;
unsigned int row;
const char * inputFileName;
pm_proginit(&argc, argv);
if (argc-1 < 1)
inputFileName = "-";
else {
inputFileName = argv[1];
if (argc-1 > 1)
pm_error("There are no options and only one argument. "
"You specified %u", argc-1);
}
ifP = pm_openr(inputFileName);
gin = pgm_readpgm(ifP, &cols, &rows, &maxval);
pm_close(ifP);
gout = pgm_allocarray(cols, rows);
for (row = 0; row < rows; ++row) {
unsigned int col;
for (col = 0; col < cols; ++col)
gout[row][col] = 0;
}
for (row = 0; row < rows; ++row) {
unsigned int col;
for (col = 0; col < cols; ++col) {
unsigned int const brow = MIN(rows-1, row + gin[row][col] / N);
gout[brow][col] = gin[row][col];
}
}
pgm_writepgm(stdout, gout, cols, rows, maxval, 0);
pm_close(stdout);
pgm_freearray(gout, rows);
return 0;
}
|
#include <stdio.h>
void foo(void)
{
int i;
printf("%d\n",i);
i = 777;
}
int main(void)
{
foo();
printf("hello\n");
foo();
return 0;
}
|
/*
* bsp_fcgi.h
*
* Copyright (C) 2014 - Dr.NP
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* FastCGI header
*
* @packet libbsp-core
* @author Dr.NP <np@bsgroup.org>
* @update 05/08/2014
* @chagelog
* [05/08/2014] - Creation
*/
#ifndef _LIB_BSP_CORE_FCGI_H
#define _LIB_BSP_CORE_FCGI_H
/* Headers */
/* Definations */
#define FCGI_BEGIN_REQUEST 0x1
#define FCGI_ABORT_REQUEST 0x2
#define FCGI_END_REQUEST 0x3
#define FCGI_PARAMS 0x4
#define FCGI_STDIN 0x5
#define FCGI_STDOUT 0x6
#define FCGI_STDERR 0x7
#define FCGI_DATA 0x8
#define FCGI_GET_VALUES 0x9
#define FCGI_GET_VALUES_RESULT 0xa
#define FCGI_UNKNOWN_TYPE 0xb
#define FCGI_MAXTYPE (FCGI_UNKNOWN_TYPE)
#define FCGI_RESPONDER 0x1
#define FCGI_AUTHORIZER 0x2
#define FCGI_FILTER 0x3
#define FCGI_REQUEST_COMPLETE 0x0
#define FCGI_CANT_MPX_CONN 0x1
#define FCGI_OVERLOADED 0x2
#define FCGI_UNKNOWN_ROLE 0x3
#define FCGI_PARAMS_DEFAULT_SERVER_PROTOCOL "HTTP/1.1"
#define FCGI_PARAMS_DEFAULT_GATEWAY_INTERFACE "CGI/1.1"
#define FCGI_PARAMS_DEFAULT_SERVER_SOFTWARE "BS.Play_FCGI_Client"
#define FCGI_CALLBACK_KEY_SUFFIX "_FCGI_CALLBACK_KEY"
/* Macros */
/* Structs */
typedef struct bsp_nv_t
{
const char *name;
const char *value;
} BSP_NV;
typedef struct bsp_fcgi_params_t
{
const char *query_string;
const char *request_method;
const char *content_type;
const char *content_length;
const char *script_filename;
const char *script_name;
const char *request_uri;
const char *document_uri;
const char *document_root;
const char *server_protocol;
const char *gateway_interface;
const char *server_software;
const char *remote_addr;
const char *remote_port;
const char *server_addr;
const char *server_port;
const char *server_name;
} BSP_FCGI_PARAMS;
typedef struct bsp_fcgi_response_t
{
int request_id;
int app_status;
int protocol_status;
int is_ended;
BSP_STRING *data_stdout;
BSP_STRING *data_stderr;
} BSP_FCGI_RESPONSE;
struct bsp_fcgi_upstream_entry_t
{
const char *host;
const char *sock;
const char *script_filename;
int port;
int weight;
};
typedef struct bsp_fcgi_upstream_t
{
const char *name;
const char *callback_key;
struct bsp_fcgi_upstream_entry_t
**pool;
size_t pool_size;
} BSP_FCGI_UPSTREAM;
/* Functions */
// Build FastCGI request
BSP_STRING * build_fcgi_request(BSP_FCGI_PARAMS *params, BSP_STRING *post_data);
// Parse FCGI response
size_t parse_fcgi_response(BSP_FCGI_RESPONSE *resp, BSP_STRING *data);
// New upstream (Server group)
BSP_FCGI_UPSTREAM * new_fcgi_upstream(const char *name);
// Del upstream
int del_fcgi_upstream(BSP_FCGI_UPSTREAM *upstream);
// Add fastcgi server entry to upstream
void add_fcgi_server_entry(BSP_FCGI_UPSTREAM *upstream, struct bsp_fcgi_upstream_entry_t *entry);
// Select an entry from upstream (Rate calculated by weight)
struct bsp_fcgi_upstream_entry_t * get_fcgi_upstream_entry(BSP_FCGI_UPSTREAM *upstream);
// Send FCGI request
int fcgi_call(BSP_FCGI_UPSTREAM *upstream, BSP_OBJECT *p, struct sockaddr_storage *addr);
#endif /* _LIB_BSP_CORE_FCGI_H */
|
#include <stdlib.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#define F_CPU 16000000UL
#include <util/delay.h>
#include "usbbuf.h"
#include "lcd.h"
int main(void)
{
lcd_init(LCD_DISP_ON);
lcd_clrscr();
usbBufInit();
//enable global interrupts
sei();
usb_puts_P("Hallo, dies ist eine Test.\n");
for (;;) /* main event loop */
{
char data= usb_getc();
if(data)
{
lcd_putc(data);
usb_putc(data);
}
usbPoll();
}
return 0;
}
|
/**
* RobotQt - Robot Simulation
* Copyright (C) 2010 Felipe Ferreri Tonello
*
* This file is part of RobotQt.
*
* RobotQt 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.
*
* RobotQt 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 RobotQt. If not, see <http://www.gnu.org/licenses/>.
*
* ----
*
* pluginhandler.cpp
* RobotQt - Robot Simulation
* http://robotqt.org/
*
* Created by Felipe Tonello on 2011-06-20.
*
*
* Revision: $Rev$
* Author: $Author$
* Date: $Date$
*/
#ifndef PLUGINHANDLER_H
#define PLUGINHANDLER_H
#include <QXmlDefaultHandler>
#include <QString>
#include <QMultiMap>
#include "plugin.h"
class QGraphicsView;
/**
* This class implements a simple SAX XML parser handler
*/
class PluginHandler : public QXmlDefaultHandler {
public:
enum PluginType {
Scenario,
Sensor,
Robot
};
typedef QMultiMap<PluginType, Plugin *> MMPlugin;
~PluginHandler();
/**
* Returns the, only available, instance of PluginHandler class
*/
static PluginHandler * getInstance();
void setGraphicsView(QGraphicsView *graphicsView);
bool startDocument();
bool endDocument();
bool startElement(const QString &namespaceURI,
const QString &localName,
const QString &qName,
const QXmlAttributes &atts);
bool endElement(const QString &namespaceURI,
const QString &localName,
const QString &qName);
bool characters(const QString &ch);
bool fatalError(const QXmlParseException &exception);
QString errorString() const;
MMPlugin pluginMM() const;
private:
QGraphicsView *m_graphicsView;
QString m_currentText;
QString m_errorStr;
bool m_metDrawingTag;
bool m_metPluginTag;
PluginType m_pluginType;
Plugin *m_curPlugin;
MMPlugin m_MMPlugin;
// Singleton variable
static PluginHandler *m_pPluginHandler;
// private to protect the singleton pattern
PluginHandler();
};
#endif // PLUGINHANDLER_H
|
/*=========================================================================
Program: ParaView
Module: vtkSMObject.h
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkSMObject - superclass for most server manager classes
// .SECTION Description
// vtkSMObject is mostly to tag a class hierarchy that it belong to the
// servermanager.
#ifndef vtkSMObject_h
#define vtkSMObject_h
#include "vtkPVServerManagerCoreModule.h" //needed for exports
#include "vtkObject.h"
class vtkSMApplication;
class VTKPVSERVERMANAGERCORE_EXPORT vtkSMObject : public vtkObject
{
public:
static vtkSMObject* New();
vtkTypeMacro(vtkSMObject, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
protected:
vtkSMObject();
~vtkSMObject();
private:
vtkSMObject(const vtkSMObject&); // Not implemented
void operator=(const vtkSMObject&); // Not implemented
};
#endif
|
/*Вариант2 Задание1 Багаев */
#include<stdio.h>
#include<math.h>
#include <time.h>
#define SIZE 10
void my_func(int A[SIZE]);
int generate();
int A[SIZE];
int main()
{
generate();
printf("\n");
my_func(A);
printf("\n");
return 1;
}
int generate()
{
int i;
srand(time(NULL));
for(i=0; i<SIZE;i++)
{
A[i]=rand()%10;
printf("%d ",A[i]);
}
return A;
}
void my_func(int A[SIZE])
{
int i,buf;
for (i=0;i<SIZE;i=i+2)
{
buf=A[i];
A[i]=A[i+1];
A[i+1]=buf;
}
for (i=0;i<SIZE;i++)
printf("%d ",A[i]);
} |
#pragma once
#include <string>
#include <ctime>
#include <memory>
#include <vector>
#include "ai_config.h"
#include "authorized_users.h"
#include "listeners/Listener.h"
// TODO update Biicode config
//#include "network_io.h"
#include "cyrillrx/cross_api/src/network_io.h"
#include "network_io/server_config.h"
class Server;
class AI : public std::enable_shared_from_this<AI>
{
public:
AI(std::unique_ptr<ai_config> aiConfig, std::unique_ptr<authorized_users> users);
~AI();
void startConnection(std::unique_ptr<network_io::server_config> serverConfig);
void stopConnection();
bool isAuthorized(const std::string& securityToken);
std::string getUser(const std::string& securityToken);
std::string getName();
void welcome(const std::string& securityToken);
void say(const std::string& textToSpeak, const bool& text_only = false);
bool toggleMute();
private:
std::unique_ptr<ai_config> config_;
std::unique_ptr<authorized_users> users_;
std::unique_ptr<text_to_speech::voice> voice_;
std::vector<std::unique_ptr<Listener>> listeners_;
time_t lastWelcome_;
AI(const AI&);
const AI& operator=(const AI&);
void start();
void shutdown();
};
|
/*
* Copyright 2013 Tilera Corporation. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, version 2.
*
* 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, GOOD TITLE or
* NON INFRINGEMENT. See the GNU General Public License for
* more details.
*/
/*
* Implementation of UART gxio calls.
*/
#include <linux/io.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <gxio/uart.h>
#include <gxio/iorpc_globals.h>
#include <gxio/iorpc_uart.h>
#include <gxio/kiorpc.h>
int gxio_uart_init(gxio_uart_context_t *context, int uart_index)
{
char file[32];
int fd;
snprintf(file, sizeof(file), "uart/%d/iorpc", uart_index);
fd = hv_dev_open((HV_VirtAddr) file, 0);
if (fd < 0)
{
if (fd >= GXIO_ERR_MIN && fd <= GXIO_ERR_MAX)
{
return fd;
}
else
{
return -ENODEV;
}
}
context->fd = fd;
/* Map in the MMIO space. */
context->mmio_base = (void __force *)
iorpc_ioremap(fd, HV_UART_MMIO_OFFSET, HV_UART_MMIO_SIZE);
if (context->mmio_base == NULL)
{
hv_dev_close(context->fd);
context->fd = -1;
return -ENODEV;
}
return 0;
}
EXPORT_SYMBOL_GPL(gxio_uart_init);
int gxio_uart_destroy(gxio_uart_context_t *context)
{
iounmap((void __force __iomem *)(context->mmio_base));
hv_dev_close(context->fd);
context->mmio_base = NULL;
context->fd = -1;
return 0;
}
EXPORT_SYMBOL_GPL(gxio_uart_destroy);
/* UART register write wrapper. */
void gxio_uart_write(gxio_uart_context_t *context, uint64_t offset,
uint64_t word)
{
__gxio_mmio_write(context->mmio_base + offset, word);
}
EXPORT_SYMBOL_GPL(gxio_uart_write);
/* UART register read wrapper. */
uint64_t gxio_uart_read(gxio_uart_context_t *context, uint64_t offset)
{
return __gxio_mmio_read(context->mmio_base + offset);
}
EXPORT_SYMBOL_GPL(gxio_uart_read);
|
#ifndef D0VZ_H
#define D0VZ_H
#define PROGNAME "d0vz"
#define VZ_SPOOLFMT "%s%llu_%s_%s"
//#define DEBUG
#ifdef DEBUG
#define DPRINT(format, args...) printf("%s: "format"\n", __FUNCTION__, ##args)
#else
#define DPRINT(format, args...) do { /* nothing */ } while (0)
#endif
struct port_t {
char *path;
pid_t pid; // stores the pid of the child process
struct port_t * next;
};
struct channel_t {
char * oid; // 1-0:1.8.0*255
char * uuid; // aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
char value[32]; // last value read (set during runtime, not by config)
struct channel_t * next;
};
struct device_t {
char * oid; // e.g. 0-0:C.1.0*255
char * serial; // 12345 from 0-0:C.1.0*255(12345)
// channel 1-0:1.8.0*255 aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
struct channel_t * channel;
struct device_t * next;
};
struct config_t {
char * log;
char * spool;
// port /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_xxxxxxxx-if00-port0
struct port_t * port;
// device 0-0:C.1.0*255 12345
struct device_t * device;
};
#endif
|
/**
* This file is part of the "clip" project
* Copyright (c) 2018 Paul Asmuth
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "context.h"
#include "sexpr.h"
#include "return_code.h"
namespace clip {
ReturnCode draw_eval(
Context* ctx,
const Expr* expr);
} // namespace clip
|
/*
Unix SMB/CIFS implementation.
Copyright (C) Ralph Boehme 2014
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 "includes.h"
#include "system/filesys.h"
#include "libcli/libcli.h"
#include "../lib/util/dlinklist.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
#include "lib/cmdline/popt_common.h"
#include "param/param.h"
#include "libcli/resolve/resolve.h"
#include "torture/util.h"
#include "torture/smbtorture.h"
#include "torture/vfs/proto.h"
#include "torture/smb2/proto.h"
static bool wrap_2ns_smb2_test(struct torture_context *torture_ctx,
struct torture_tcase *tcase,
struct torture_test *test)
{
bool (*fn) (struct torture_context *, struct smb2_tree *, struct smb2_tree *);
bool ok;
struct smb2_tree *tree1 = NULL;
struct smb2_tree *tree2 = NULL;
TALLOC_CTX *mem_ctx = talloc_new(torture_ctx);
if (!torture_smb2_connection(torture_ctx, &tree1)) {
torture_fail(torture_ctx,
"Establishing SMB2 connection failed\n");
return false;
}
/*
* This is a trick:
* The test might close the connection. If we steal the tree context
* before that and free the parent instead of tree directly, we avoid
* a double free error.
*/
talloc_steal(mem_ctx, tree1);
ok = torture_smb2_con_sopt(torture_ctx, "share2", &tree2);
if (ok) {
talloc_steal(mem_ctx, tree2);
}
fn = test->fn;
ok = fn(torture_ctx, tree1, tree2);
/* the test may already have closed some of the connections */
talloc_free(mem_ctx);
return ok;
}
/*
* Run a test with 2 connected trees, the default share and another
* taken from option strings "torture:share2"
*/
struct torture_test *torture_suite_add_2ns_smb2_test(struct torture_suite *suite,
const char *name,
bool (*run)(struct torture_context *,
struct smb2_tree *,
struct smb2_tree *))
{
struct torture_test *test;
struct torture_tcase *tcase;
tcase = torture_suite_add_tcase(suite, name);
test = talloc(tcase, struct torture_test);
test->name = talloc_strdup(test, name);
test->description = NULL;
test->run = wrap_2ns_smb2_test;
test->fn = run;
test->dangerous = false;
DLIST_ADD_END(tcase->tests, test);
return test;
}
NTSTATUS torture_vfs_init(TALLOC_CTX *ctx)
{
struct torture_suite *suite = torture_suite_create(
ctx, "vfs");
suite->description = talloc_strdup(suite, "VFS modules tests");
torture_suite_add_suite(suite, torture_vfs_fruit(suite));
torture_suite_add_suite(suite, torture_vfs_fruit_netatalk(suite));
torture_suite_add_suite(suite, torture_acl_xattr(suite));
torture_suite_add_suite(suite, torture_vfs_fruit_file_id(suite));
torture_suite_add_suite(suite, torture_vfs_fruit_timemachine(suite));
torture_register_suite(ctx, suite);
return NT_STATUS_OK;
}
|
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
// ResInsight 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.
//
// ResInsight 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 at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RifEclipseRestartDataAccess.h"
class RifEclipseOutputFileTools;
//typedef struct ecl_file_struct ecl_file_type;
#include "well_info.h"
//==================================================================================================
//
// Class for access to results from a unified restart file
//
//==================================================================================================
class RifEclipseUnifiedRestartFileAccess : public RifEclipseRestartDataAccess
{
public:
RifEclipseUnifiedRestartFileAccess();
virtual ~RifEclipseUnifiedRestartFileAccess();
void setRestartFiles(const QStringList& fileSet);
bool open();
void close();
size_t timeStepCount();
std::vector<QDateTime> timeSteps();
std::vector<int> reportNumbers();
void resultNames(QStringList* resultNames, std::vector<size_t>* resultDataItemCounts);
bool results(const QString& resultName, size_t timeStep, size_t gridCount, std::vector<double>* values);
virtual void readWellData(well_info_type * well_info, bool importCompleteMswData);
virtual int readUnitsType();
private:
bool openFile();
private:
QString m_filename;
ecl_file_type* m_ecl_file;
};
|
#include <stdio.h>
#include <dis.h>
#include <dic.h>
char str[10][80];
void rout( tag, buf, size )
char *buf;
int *tag, *size;
{
printf("%s Received for Server %d\n", buf, *tag);
}
main(argc,argv)
int argc;
char **argv;
{
char aux[80];
int n;
sscanf(argv[1], "%d", &n);
sprintf(aux,"TEST_SLAC/SRV%d",n);
sprintf(str[0], aux);
dis_add_service(aux, "C", str[0], strlen(str[0])+1, (void *)0, 0);
sprintf(aux,"TEST_SLAC/%d",n);
dis_start_serving(aux);
sprintf(aux,"TEST_SLAC/CLT%d",n);
dic_info_service( aux, TIMED, 60, 0, 0, rout, n,
"No Link", 8 );
while(1)
{
pause();
}
}
|
#ifndef _mggencc0nf
#define _mggencc0nf
// #define REST_SIMPLE
#endif |
/*
Safe Ramdisk:
A simple Windows driver to emulate a FAT32 formatted disk drive
backed by paged memory in the Windows kernel.
Copyright (C) 2014 Rian Hunter <rian@alum.mit.edu>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef __safe_ramdisk_ioctl_h
#define __safe_ramdisk_ioctl_h
#ifndef CTL_CODE
#define CTL_CODE(DeviceType, Function, Method, Access)( \
((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
#endif
#ifndef METHOD_BUFFERED
#define METHOD_BUFFERED 0
#endif
#define FILE_DEVICE_SAFE_RAMDISK_CTL 0x8373
#define IOCTL_SAFE_RAMDISK_ENGAGE \
((ULONG) CTL_CODE(FILE_DEVICE_SAFE_RAMDISK_CTL, 0x800, METHOD_BUFFERED, 0))
#define IOCTL_SAFE_RAMDISK_DISENGAGE \
((ULONG) CTL_CODE(FILE_DEVICE_SAFE_RAMDISK_CTL, 0x801, METHOD_BUFFERED, 0))
#define RAMDISK_CTL_DOSNAME_W L"SafeDos"
#define SAFE_RAMDISK_SIZE_VALUE_NAME_W L"RAMDiskSize"
#endif
|
#ifndef RUNNER_H
#define RUNNER_H
#include <QObject>
namespace CorpusAnalyser
{
class Runner : public QObject
{
Q_OBJECT
public:
explicit Runner(QObject *parent = 0);
void Update(const int& updateType, const QString& message);
signals:
void update(const int& updateType, const QString& message);
public slots:
};
} // namespace CorpusAnalyser
#endif // RUNNER_H
|
#ifndef VIDEO_H
#define VIDEO_H
#include "image.h"
/* Video data structure
DELAY_HI, DELAY_LO
RESERVED
RESERVED
FRAME_COUNT_HI, FRAME_COUNT_LO
TABLE_ENTRY_HI, TABLE_ENTRY_M1, TABLE_ENTRY_M2, TABLE_ENTRY_LO
...
IMAGE_DATA
...
*/
enum VideoDisposeMethod {
VIDEO_REDRAW,
};
enum VideoCompressionMethod {
VIDEO_IMAGE_SEQUENCE,
};
#endif |
/*
* Copyright (C) 2017 Riccardo De Benedictis <riccardo.debenedictis@istc.cnr.it>
*
* 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/>.
*/
/*
* File: constructor.h
* Author: Riccardo De Benedictis <riccardo.debenedictis@istc.cnr.it>
*
* Created on 31 marzo 2017, 10.14
*/
#ifndef CONSTRUCTOR_H
#define CONSTRUCTOR_H
#include "scope.h"
namespace core {
class constructor : public scope {
public:
constructor(environment& e, scope& s, const std::vector<field*>& args);
constructor(const constructor& orig) = delete;
virtual ~constructor();
const std::vector<field*> get_args() const;
expr new_instance(env& e, const std::vector<expr>& exprs);
virtual bool invoke(item& i, const std::vector<expr>& exprs) = 0;
protected:
const std::vector<field*> args;
};
}
#endif /* CONSTRUCTOR_H */
|
/*
* || ____ _ __
* +------+ / __ )(_) /_______________ _____ ___
* | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
* +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
* || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
*
* Crazyflie control firmware
*
* Copyright (C) 2015 Bitcraze AB
*
* 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, in version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* maxSonar.h - API for the MaxSonar MB1040 (LV-MaxSonar-EZ04)
*/
/**
* This driver assumes the ADC VREF is the same as the LV-MaxSonar-EZ4 VREF. This means
* that the MB1040 Sensor should have its VCC pin connected to the VCC pin on the deck
* port (instead of using the VCOM or VUSB pins).
*
* According to the datasheet for the MB1040, the sensor draws typically 2mA, so
* powering it with the VCC pin (50mA max) on the deck port should be safe.
*
* See also https://forum.bitcraze.io/viewtopic.php?f=6&t=1250
*/
#ifndef __MAXSONAR_H__
#define __MAXSONAR_H__
#include <stdint.h>
/**
* \def MAXSONAR_ENABLED
* Enable the MaxSonar driver (used by the proximity measurement subsystem).
*/
//#define MAXSONAR_ENABLED
/**
* \def MAXSONAR_DECK_GPIO
* The GPIO pin to use if reading via the analog interface of a MaxSonar sensor.
*/
#define MAXSONAR_DECK_GPIO DECK_GPIO_TX2
/**
* \def MAXSONAR_LOG_ENABLED
* Uncomment to enable log variables for this driver.
*/
//#define MAXSONAR_LOG_ENABLED
/**
* List of MaxBotix sensors with different interface types can be added here.
*
* Sensors should be listed once for each interface, for instance MB1040AN (Analog), MB1040I2C (I2C), MB1040PWM (PWM) etc.
*/
typedef enum {
MAXSONAR_MB1040_AN = 0, /* The MB1040 (LV-MaxSonar-EZ4) sensor read by analog conversion (GPIO pin read by ADC). */
} maxSonarSensor_t;
uint32_t maxSonarReadDistance(maxSonarSensor_t type, uint32_t *accuracy);
#endif
|
/*
* Copyright 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DeviceMotionClient_h
#define DeviceMotionClient_h
namespace WebCore {
class DeviceMotionController;
class DeviceMotionData;
class Page;
class DeviceMotionClient {
public:
virtual ~DeviceMotionClient() {}
virtual void setController(DeviceMotionController*) = 0;
virtual void startUpdating() = 0;
virtual void stopUpdating() = 0;
virtual DeviceMotionData* currentDeviceMotion() const = 0;
virtual void deviceMotionControllerDestroyed() = 0;
};
void provideDeviceMotionTo(Page*, DeviceMotionClient*);
} // namespace WebCore
#endif // DeviceMotionClient_h
|
/**********************************************************
* Version $Id$
*********************************************************/
///////////////////////////////////////////////////////////
// //
// SAGA //
// //
// System for Automated Geoscientific Analyses //
// //
// Module Library: //
// grid_spline //
// //
//-------------------------------------------------------//
// //
// Gridding_Spline_TPS_TIN.h //
// //
// Copyright (C) 2006 by //
// Olaf Conrad //
// //
//-------------------------------------------------------//
// //
// This file is part of 'SAGA - System for Automated //
// Geoscientific Analyses'. SAGA is free software; you //
// can redistribute it and/or modify it under the terms //
// of the GNU General Public License as published by the //
// Free Software Foundation; version 2 of the License. //
// //
// SAGA 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, 5th Floor, Boston, MA 02110-1301, //
// USA. //
// //
//-------------------------------------------------------//
// //
// e-mail: oconrad@saga-gis.org //
// //
// contact: Olaf Conrad //
// Institute of Geography //
// University of Goettingen //
// Goldschmidtstr. 5 //
// 37077 Goettingen //
// Germany //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
#ifndef HEADER_INCLUDED__Gridding_Spline_TPS_TIN_H
#define HEADER_INCLUDED__Gridding_Spline_TPS_TIN_H
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
#include "Gridding_Spline_Base.h"
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
class CGridding_Spline_TPS_TIN : public CGridding_Spline_Base
{
public:
CGridding_Spline_TPS_TIN(void);
protected:
virtual bool On_Execute (void);
private:
double m_Regularisation;
int m_nPoints, m_nPoints_Buf, m_Level;
CSG_TIN_Node **m_Points;
bool _Initialise (void);
bool _Finalise (void);
void _Set_Triangle (CSG_TIN_Triangle *pTriangle);
void _Set_Grid (CSG_TIN_Triangle *pTriangle, CSG_Thin_Plate_Spline &Spline);
void _Add_Points (CSG_TIN_Node *Point, int Level);
bool _Add_Point (CSG_TIN_Node *Point);
bool _Get_TIN (CSG_TIN &TIN);
};
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
#endif // #ifndef HEADER_INCLUDED__Gridding_Spline_TPS_TIN_H
|
/*
This file is part of Desperion.
Copyright 2010, 2011 LittleScaraby, Nekkro
Desperion 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.
Desperion 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 Desperion. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __ABSTRACT_GAME_ACTION_MESSAGE__
#define __ABSTRACT_GAME_ACTION_MESSAGE__
class AbstractGameActionMessage : public DofusMessage
{
public:
int16 actionId;
int sourceId;
uint16 GetOpcode() const
{ return SMSG_ABSTRACT_GAME_ACTION; }
AbstractGameActionMessage()
{
}
AbstractGameActionMessage(int16 actionId, int sourceId) : actionId(actionId), sourceId(sourceId)
{
}
void Serialize(ByteBuffer& data) const
{
data<<actionId<<sourceId;
}
void Deserialize(ByteBuffer& data)
{
data>>actionId>>sourceId;
}
};
#endif |
/*
* This is an abstract base class for varies of works.
*/
#ifndef WORKBASE_H
#define WORKBASE_H
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "core_lib.h"
#include <QDebug>
namespace CAIGA {
class WorkBase
{
public:
enum WorkTypes {Raw, AptBilateralFilter, Binaryzation, BoxFilter, Canny, Contours, Eraser, FloodFill, HistEqualise, InvertGrayscale, MedianBlur, Pencil, Watershed, Gradient};
WorkBase() : src(NULL) {
workType = Raw;
dst = new cv::Mat();
display = dst;
markerMatrix = NULL;
inputMarker = NULL;
}
WorkBase(const cv::Mat *s) : src(s) {
workType = Raw;
dst = new cv::Mat(s->clone());
display = dst;
markerMatrix = NULL;
inputMarker = NULL;
}
WorkBase(const cv::Mat *s, const cv::Mat *d) : src(s) {
workType = Raw;
dst = new cv::Mat(d->clone());
display = dst;
markerMatrix = NULL;
inputMarker = NULL;
}
WorkBase(WorkBase *base) : src(base->src) {
workType = base->workType;
dst = new cv::Mat(base->dst->clone());
display = base->display == base->dst ? dst : new cv::Mat (base->display->clone());
markerMatrix = base->markerMatrix == NULL ? NULL : new cv::Mat(base->markerMatrix->clone());
inputMarker = base->inputMarker == NULL ? NULL : new cv::Mat(base->inputMarker->clone());
oddSize = base->oddSize;
size = base->size;
cvSize = base->cvSize;
method = base->method;
type = base->type;
constant = base->constant;
sigmaX = base->sigmaX;
sigmaY = base->sigmaY;
b = base->b;
pointVec = base->pointVec;
contours = base->contours;
}
virtual ~WorkBase()
{
if (display != dst) {//don't delete the same pointer twice
delete display;
}
if (markerMatrix != NULL) {
delete markerMatrix;
}
if (inputMarker != NULL) {
delete inputMarker;
}
delete dst;
}
virtual void Func() {}
inline bool operator == (const WorkBase &w) const {
if (this->src != w.src || this->dst != w.dst || this->inputMarker != w.inputMarker || this->display != w.display || this->workType != w.workType) {
return false;
}
else
return true;
}
WorkTypes workType;
const cv::Mat *src;//share memory with other WorkBase(s)
cv::Mat *dst;//to be next work's source Mat
cv::Mat *inputMarker;//inputMarker is the "seeds" used in watershed
/*
* sometimes *display may be the same Mat as *dst
* if it's not, commonly seen where there is a mask, handle it carefully.
*/
cv::Mat *display;//used to display on screen
cv::Mat *markerMatrix;//keep watershed output
int oddSize;//should always be an odd number //red
int size;//may be odd or even //green
cv::Size cvSize;
int method;//point.x in ffill //blue
int type;//point.y in ffill
double constant;
double sigmaX;//sigmaSpace in adaptiveBilateralFilter; high_diff in ffill
double sigmaY;//sigmaColor in adaptiveBilateralFilter; low_diff in ffill
bool b;
std::vector<cv::Point_<qreal> > pointVec;
//analysis is based on contours
std::vector<std::vector<cv::Point> > contours;//contous cannot use float points
};
}
#endif // WORKBASE_H
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "blaze.h"
#include <stdarg.h>
#include <ctype.h>
int errors=0, warnings=0;
static void find_line(const char* string, int line, const char** b, size_t* e) {
const char* p;
while (line-1) {
p = strchr(string, '\n');
if (!p) {
*b = string;
*e = strlen(string);
return;
}
--line;
string = p+1;
}
*b = string;
p = strchr(string, '\n');
*e = p ? p-string : strlen(string);
}
static inline void generic_error(const char* name, Location loc, const char* fm,
va_list args) {
const char* b;
size_t e;
int c=0;
fprintf(stderr, "\033[1m%s:%d:%d: %s: \033[0m\033[1m", loc.file,
loc.first_line, loc.first_column, name);
vfprintf(stderr, fm, args);
fputs("\033[0m", stderr);
find_line(loc.fcont, loc.first_line, &b, &e);
for (; *b && isspace(*b) && *b != '\n'; ++b, ++c);
fprintf(stderr, "\n %.*s\n", (int)e-c, b);
fputs(" ", stderr);
for (++c; c<loc.first_column; ++c) fputc(' ', stderr);
fputs("\033[32m", stderr);
for (; c<loc.last_column+1; ++c) fputc('~', stderr);
fputs("\033[0m\n", stderr);
}
#define generic_error_func(n,c,x) void n(Location loc, const char* fm, ...) {\
va_list args;\
va_start(args, fm);\
generic_error("\033[3" #c "m" #n , loc, fm, args);\
va_end(args);\
x\
}
generic_error_func(error,1,++errors;)
generic_error_func(warning,5,++warnings;)
generic_error_func(note,6,)
Node* declared_here(Node* n) {
Node* t = NULL;
switch (n->kind) {
case Nfun: case Ndecl:
note(n->loc, "'%s' declared here", n->s->str);
break;
case Nid:
if (n->e && n->e->n && n->e->n->loc.file) {
if (n->e->n->kind != Nfun && n->e->n->kind != Ndecl)
note(n->e->n->loc, "'%s' declared here", n->s->str);
t = declared_here(n->e->n);
}
break;
case Nlet: case Naddr: case Nderef: case Nindex:
t = declared_here(n->sons[0]);
break;
case Nattr:
declared_here(n->sons[0]);
if (n->attr) t = declared_here(n->attr);
break;
default: return NULL;
}
return t ? t : n;
}
void make_mutvar(Node* n, int flag, int curflags) {
if (!n) return;
bassert(flag == Fmut || flag == Fvar, "unexpected flag %d", flag);
if (flag & Fvar && curflags & Fmut)
note(n->loc, "change 'mut' to 'var' to make it variable");
else {
const char* spec = flag == Fvar ? "var" : "mut";
const char* word = flag == Fvar ? "variable" : "mutable";
note(n->loc, "add '%s' to make it %s", spec, word);
}
}
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* This file is part of the libetonyek project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef IWORKLINEENDELEMENT_H_INCLUDED
#define IWORKLINEENDELEMENT_H_INCLUDED
#include <boost/optional.hpp>
#include "IWORKTypes.h"
#include "IWORKXMLContextBase.h"
namespace libetonyek
{
class IWORKLineEndElement : public IWORKXMLElementContextBase
{
public:
explicit IWORKLineEndElement(IWORKXMLParserState &state, boost::optional<IWORKMarker> &value);
private:
void attribute(int name, const char *value) override;
IWORKXMLContextPtr_t element(int name) override;
boost::optional<IWORKMarker> &m_value;
boost::optional<ID_t> m_id;
};
}
#endif // IWORKLINEENDELEMENT_H_INCLUDED
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsStringBuffer_h__
#define nsStringBuffer_h__
#include "mozilla/Atomics.h"
#include "mozilla/MemoryReporting.h"
template<class T> struct already_AddRefed;
/**
* This structure precedes the string buffers "we" allocate. It may be the
* case that nsTAString::mData does not point to one of these special
* buffers. The mFlags member variable distinguishes the buffer type.
*
* When this header is in use, it enables reference counting, and capacity
* tracking. NOTE: A string buffer can be modified only if its reference
* count is 1.
*/
class nsStringBuffer
{
private:
friend class CheckStaticAtomSizes;
mozilla::Atomic<int32_t> mRefCount;
uint32_t mStorageSize;
public:
/**
* Allocates a new string buffer, with given size in bytes and a
* reference count of one. When the string buffer is no longer needed,
* it should be released via Release.
*
* It is up to the caller to set the bytes corresponding to the string
* buffer by calling the Data method to fetch the raw data pointer. Care
* must be taken to properly null terminate the character array. The
* storage size can be greater than the length of the actual string
* (i.e., it is not required that the null terminator appear in the last
* storage unit of the string buffer's data).
*
* @return new string buffer or null if out of memory.
*/
static already_AddRefed<nsStringBuffer> Alloc(size_t aStorageSize);
/**
* Resizes the given string buffer to the specified storage size. This
* method must not be called on a readonly string buffer. Use this API
* carefully!!
*
* This method behaves like the ANSI-C realloc function. (i.e., If the
* allocation fails, null will be returned and the given string buffer
* will remain unmodified.)
*
* @see IsReadonly
*/
static nsStringBuffer* Realloc(nsStringBuffer* aBuf, size_t aStorageSize);
/**
* Increment the reference count on this string buffer.
*/
void NS_FASTCALL AddRef();
/**
* Decrement the reference count on this string buffer. The string
* buffer will be destroyed when its reference count reaches zero.
*/
void NS_FASTCALL Release();
/**
* This method returns the string buffer corresponding to the given data
* pointer. The data pointer must have been returned previously by a
* call to the nsStringBuffer::Data method.
*/
static nsStringBuffer* FromData(void* aData)
{
return reinterpret_cast<nsStringBuffer*>(aData) - 1;
}
/**
* This method returns the data pointer for this string buffer.
*/
void* Data() const
{
return const_cast<char*>(reinterpret_cast<const char*>(this + 1));
}
/**
* This function returns the storage size of a string buffer in bytes.
* This value is the same value that was originally passed to Alloc (or
* Realloc).
*/
uint32_t StorageSize() const
{
return mStorageSize;
}
/**
* If this method returns false, then the caller can be sure that their
* reference to the string buffer is the only reference to the string
* buffer, and therefore it has exclusive access to the string buffer and
* associated data. However, if this function returns true, then other
* consumers may rely on the data in this buffer being immutable and
* other threads may access this buffer simultaneously.
*/
bool IsReadonly() const
{
return mRefCount > 1;
}
/**
* The FromString methods return a string buffer for the given string
* object or null if the string object does not have a string buffer.
* The reference count of the string buffer is NOT incremented by these
* methods. If the caller wishes to hold onto the returned value, then
* the returned string buffer must have its reference count incremented
* via a call to the AddRef method.
*/
static nsStringBuffer* FromString(const nsAString& aStr);
static nsStringBuffer* FromString(const nsACString& aStr);
/**
* The ToString methods assign this string buffer to a given string
* object. If the string object does not support sharable string
* buffers, then its value will be set to a copy of the given string
* buffer. Otherwise, these methods increment the reference count of the
* given string buffer. It is important to specify the length (in
* storage units) of the string contained in the string buffer since the
* length of the string may be less than its storage size. The string
* must have a null terminator at the offset specified by |len|.
*
* NOTE: storage size is measured in bytes even for wide strings;
* however, string length is always measured in storage units
* (2-byte units for wide strings).
*/
void ToString(uint32_t aLen, nsAString& aStr, bool aMoveOwnership = false);
void ToString(uint32_t aLen, nsACString& aStr, bool aMoveOwnership = false);
/**
* This measures the size only if the StringBuffer is unshared.
*/
size_t SizeOfIncludingThisIfUnshared(mozilla::MallocSizeOf aMallocSizeOf) const;
/**
* This measures the size regardless of whether the StringBuffer is
* unshared.
*
* WARNING: Only use this if you really know what you are doing, because
* it can easily lead to double-counting strings. If you do use them,
* please explain clearly in a comment why it's safe and won't lead to
* double-counting.
*/
size_t SizeOfIncludingThisEvenIfShared(mozilla::MallocSizeOf aMallocSizeOf) const;
};
#endif /* !defined(nsStringBuffer_h__ */
|
#include <deai/deai.h>
#include <deai/helper.h>
#include <assert.h>
#include "common.h"
DEAI_PLUGIN_ENTRY_POINT(di) {
auto object = di_new_object_with_type(struct di_object);
auto handler = di_new_object_with_type(struct di_object);
auto listen_handle = di_listen_to(object, di_string_borrow("some_event"), handler);
di_unref_object(handler);
di_unref_object(object);
di_unref_object(listen_handle);
return 0;
}
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla 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.mozilla.org/MPL/
*
* 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.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsTextEditUtils_h__
#define nsTextEditUtils_h__
#include "prtypes.h" // for PRBool
#include "nsError.h" // for nsresult
#include "nsString.h" // for nsAString
class nsIDOMNode;
class nsIEditor;
class nsPlaintextEditor;
class nsTextEditUtils
{
public:
// from nsTextEditRules:
static PRBool IsBody(nsIDOMNode *aNode);
static PRBool IsBreak(nsIDOMNode *aNode);
static PRBool IsMozBR(nsIDOMNode *aNode);
static PRBool HasMozAttr(nsIDOMNode *aNode);
static PRBool InBody(nsIDOMNode *aNode, nsIEditor *aEditor);
};
/***************************************************************************
* stack based helper class for detecting end of editor initialization, in
* order to triger "end of init" initialization of the edit rules.
*/
class nsAutoEditInitRulesTrigger
{
private:
nsPlaintextEditor *mEd;
nsresult &mRes;
public:
nsAutoEditInitRulesTrigger( nsPlaintextEditor *aEd, nsresult &aRes);
~nsAutoEditInitRulesTrigger();
};
#endif /* nsTextEditUtils_h__ */
|
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla 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.mozilla.org/MPL/
*
* 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.
*
* The Original Code is autocomplete code.
*
* The Initial Developer of the Original Code is
* Google Inc.
* Portions created by the Initial Developer are Copyright (C) 2005
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Brett Wilson <brettw@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __nsAutoCompleteSimpleResult__
#define __nsAutoCompleteSimpleResult__
#include "nsIAutoCompleteResult.h"
#include "nsIAutoCompleteSimpleResult.h"
#include "nsVoidArray.h"
#include "nsString.h"
#include "prtypes.h"
#include "nsCOMPtr.h"
class nsAutoCompleteSimpleResult : public nsIAutoCompleteSimpleResult
{
public:
nsAutoCompleteSimpleResult();
NS_DECL_ISUPPORTS
NS_DECL_NSIAUTOCOMPLETERESULT
NS_DECL_NSIAUTOCOMPLETESIMPLERESULT
private:
~nsAutoCompleteSimpleResult() {}
protected:
// What we really want is an array of structs with value/comment/image/style contents.
// But then we'd either have to use COM or manage object lifetimes ourselves.
// Having four arrays of string simplifies this, but is stupid.
nsStringArray mValues;
nsStringArray mComments;
nsStringArray mImages;
nsStringArray mStyles;
nsString mSearchString;
nsString mErrorDescription;
PRInt32 mDefaultIndex;
PRUint32 mSearchResult;
nsCOMPtr<nsIAutoCompleteSimpleResultListener> mListener;
};
#endif // __nsAutoCompleteSimpleResult__
|
/* This code is subject to the terms of the Mozilla Public License, v.2.0. http://mozilla.org/MPL/2.0/. */
#pragma once
#include "File.h"
#include <fstream>
#include <functional>
#include <sstream> // for now
#include <utility>
class StateSaver
{
public:
StateSaver(std::string filename)
: _filename(std::move(filename))
{}
template <class IT>
bool save(IT begin, IT end)
{
std::stringstream out;
for (IT it = begin; it != end; ++it)
out << *it << '\n';
return File::save(_filename, out.str());
}
bool load(std::function<void(const std::string&)> loadFun)
{
std::ifstream in(_filename);
if (!in.is_open())
return false;
std::string line;
while (std::getline(in, line))
loadFun(line);
return true;
}
protected:
std::string _filename;
};
|
/*
* Embedded Radio Tracker
*
* Copyright (C) 2017 Mikael Nousiainen
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef __ERT_GPS_LISTENER_H
#define __ERT_GPS_LISTENER_H
#include "ert-gps-driver.h"
struct _ert_gps_listener;
typedef void (*ert_gps_listener_callback)(struct _ert_gps_listener *listener, ert_gps_data *gps_data, void *callback_context);
typedef struct _ert_gps_listener {
ert_gps *gps;
int poll_timeout_milliseconds;
pthread_t thread;
volatile bool running;
ert_gps_listener_callback callback;
void *callback_context;
ert_gps_data gps_data;
} ert_gps_listener;
int ert_gps_listener_start(ert_gps *gps, ert_gps_listener_callback callback, void *callback_context,
int poll_timeout_milliseconds, ert_gps_listener **listener_rcv);
int ert_gps_get_current_data(ert_gps_listener *listener, ert_gps_data *gps_data);
int ert_gps_listener_stop(ert_gps_listener *listener);
#endif
|
#if 0
''' '
#endif
#ifdef __cplusplus
template <typename T>
using MaybeUninit = T;
#endif
#if 0
' '''
#endif
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef struct NotReprC______i32 NotReprC______i32;
typedef struct NotReprC______i32 Foo;
typedef struct MyStruct {
const int32_t *number;
} MyStruct;
void root(const Foo *a, const struct MyStruct *with_maybe_uninit);
|
/*-------------------------------------------------------------------------
*
* qualify_sequence_stmt.c
* Functions specialized in fully qualifying all sequence statements. These
* functions are dispatched from qualify.c
*
* Fully qualifying sequence statements consists of adding the schema name
* to the subject of the sequence.
*
* Goal would be that the deparser functions for these statements can
* serialize the statement without any external lookups.
*
* Copyright (c), Citus Data, Inc.
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "distributed/deparser.h"
#include "distributed/version_compat.h"
#include "parser/parse_func.h"
#include "utils/lsyscache.h"
/*
* QualifyAlterSequenceOwnerStmt transforms a
* ALTER SEQUENCE .. OWNER TO ..
* statement in place and makes the sequence name fully qualified.
*/
void
QualifyAlterSequenceOwnerStmt(Node *node)
{
AlterTableStmt *stmt = castNode(AlterTableStmt, node);
Assert(AlterTableStmtObjType_compat(stmt) == OBJECT_SEQUENCE);
RangeVar *seq = stmt->relation;
if (seq->schemaname == NULL)
{
Oid schemaOid = RangeVarGetCreationNamespace(seq);
seq->schemaname = get_namespace_name(schemaOid);
}
}
/*
* QualifyAlterSequenceSchemaStmt transforms a
* ALTER SEQUENCE .. SET SCHEMA ..
* statement in place and makes the sequence name fully qualified.
*/
void
QualifyAlterSequenceSchemaStmt(Node *node)
{
AlterObjectSchemaStmt *stmt = castNode(AlterObjectSchemaStmt, node);
Assert(stmt->objectType == OBJECT_SEQUENCE);
RangeVar *seq = stmt->relation;
if (seq->schemaname == NULL)
{
Oid schemaOid = RangeVarGetCreationNamespace(seq);
seq->schemaname = get_namespace_name(schemaOid);
}
}
/*
* QualifyRenameSequenceStmt transforms a
* ALTER SEQUENCE .. RENAME TO ..
* statement in place and makes the sequence name fully qualified.
*/
void
QualifyRenameSequenceStmt(Node *node)
{
RenameStmt *stmt = castNode(RenameStmt, node);
Assert(stmt->renameType == OBJECT_SEQUENCE);
RangeVar *seq = stmt->relation;
if (seq->schemaname == NULL)
{
Oid schemaOid = RangeVarGetCreationNamespace(seq);
seq->schemaname = get_namespace_name(schemaOid);
}
}
|
#ifndef OpenKAI_src_Primitive_vFloat4_H_
#define OpenKAI_src_Primitive_vFloat4_H_
#include "vFloat2.h"
#include "vFloat3.h"
namespace kai
{
struct vFloat4
{
float x;
float y;
float z;
float w;
void init(void)
{
x = 0.0;
y = 0.0;
z = 0.0;
w = 0.0;
}
void init(float v)
{
x = v;
y = v;
z = v;
w = v;
}
void init(float a, float b, float c, float d)
{
x = a;
y = b;
z = c;
w = d;
}
inline vFloat4 operator+(vFloat4& r)
{
vFloat4 v;
v.x = r.x + x;
v.y = r.y + y;
v.z = r.z + z;
v.w = r.w + w;
return v;
}
inline vFloat4 operator-(vFloat4& r)
{
vFloat4 v;
v.x = x - r.x;
v.y = y - r.y;
v.z = z - r.z;
v.w = w - r.w;
return v;
}
inline vFloat4 operator*(float r)
{
vFloat4 v;
v.x = x * r;
v.y = y * r;
v.z = z * r;
v.w = w * r;
return v;
}
inline vFloat4 operator/(float r)
{
vFloat4 v;
v.x = x / r;
v.y = y / r;
v.z = z / r;
v.w = w / r;
return v;
}
inline void operator=(float r)
{
x = r;
y = r;
z = r;
w = r;
}
inline void operator=(float* pR)
{
x = pR[0];
y = pR[1];
z = pR[2];
w = pR[3];
}
inline void operator+=(vFloat4& r)
{
x += r.x;
y += r.y;
z += r.z;
w += r.w;
}
inline void operator-=(vFloat4& r)
{
x -= r.x;
y -= r.y;
z -= r.z;
w -= r.w;
}
inline void operator*=(float r)
{
x *= r;
y *= r;
z *= r;
w *= r;
}
inline void operator/=(float r)
{
x /= r;
y /= r;
z /= r;
w /= r;
}
float midX(void)
{
return (x + z) * 0.5;
}
float midY(void)
{
return (y + w) * 0.5;
}
vFloat2 center(void)
{
vFloat2 vC;
vC.x = midX();
vC.y = midY();
return vC;
}
float width(void)
{
return z - x;
}
float height(void)
{
return w - y;
}
float area(void)
{
return abs((z - x) * (w - y));
}
float len(void)
{
return sqrt(x*x + y*y + z*z + w*w);
}
float sum(void)
{
return x + y + z + w;
}
void constrain(float a, float b)
{
x = (x<a)?a:x;
x = (x>b)?b:x;
y = (y<a)?a:y;
y = (y>b)?b:y;
z = (z<a)?a:z;
z = (z>b)?b:z;
w = (w<a)?a:w;
w = (w>b)?b:w;
}
};
}
#endif
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs"
* found in "../support/ngap-r16.4.0/38413-g40.asn"
* `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-UPER`
*/
#include "NGAP_RATRestrictionInformation.h"
int
NGAP_RATRestrictionInformation_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
if(st->size > 0) {
/* Size in bits */
size = 8 * st->size - (st->bits_unused & 0x07);
} else {
size = 0;
}
if((size == 8UL)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
/*
* This type is implemented using BIT_STRING,
* so here we adjust the DEF accordingly.
*/
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
asn_per_constraints_t asn_PER_type_NGAP_RATRestrictionInformation_constr_1 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 8, 8 } /* (SIZE(8..8,...)) */,
0, 0 /* No PER value map */
};
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
static const ber_tlv_tag_t asn_DEF_NGAP_RATRestrictionInformation_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
};
asn_TYPE_descriptor_t asn_DEF_NGAP_RATRestrictionInformation = {
"RATRestrictionInformation",
"RATRestrictionInformation",
&asn_OP_BIT_STRING,
asn_DEF_NGAP_RATRestrictionInformation_tags_1,
sizeof(asn_DEF_NGAP_RATRestrictionInformation_tags_1)
/sizeof(asn_DEF_NGAP_RATRestrictionInformation_tags_1[0]), /* 1 */
asn_DEF_NGAP_RATRestrictionInformation_tags_1, /* Same as above */
sizeof(asn_DEF_NGAP_RATRestrictionInformation_tags_1)
/sizeof(asn_DEF_NGAP_RATRestrictionInformation_tags_1[0]), /* 1 */
{
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
&asn_PER_type_NGAP_RATRestrictionInformation_constr_1,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
NGAP_RATRestrictionInformation_constraint
},
0, 0, /* No members */
&asn_SPC_BIT_STRING_specs /* Additional specs */
};
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs"
* found in "../support/ngap-r16.4.0/38413-g40.asn"
* `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-UPER`
*/
#include "NGAP_WarningAreaCoordinates.h"
int
NGAP_WarningAreaCoordinates_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
size = st->size;
if((size >= 1UL && size <= 1024UL)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
/*
* This type is implemented using OCTET_STRING,
* so here we adjust the DEF accordingly.
*/
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
static asn_per_constraints_t asn_PER_type_NGAP_WarningAreaCoordinates_constr_1 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 10, 10, 1, 1024 } /* (SIZE(1..1024)) */,
0, 0 /* No PER value map */
};
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
static const ber_tlv_tag_t asn_DEF_NGAP_WarningAreaCoordinates_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
};
asn_TYPE_descriptor_t asn_DEF_NGAP_WarningAreaCoordinates = {
"WarningAreaCoordinates",
"WarningAreaCoordinates",
&asn_OP_OCTET_STRING,
asn_DEF_NGAP_WarningAreaCoordinates_tags_1,
sizeof(asn_DEF_NGAP_WarningAreaCoordinates_tags_1)
/sizeof(asn_DEF_NGAP_WarningAreaCoordinates_tags_1[0]), /* 1 */
asn_DEF_NGAP_WarningAreaCoordinates_tags_1, /* Same as above */
sizeof(asn_DEF_NGAP_WarningAreaCoordinates_tags_1)
/sizeof(asn_DEF_NGAP_WarningAreaCoordinates_tags_1[0]), /* 1 */
{
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
&asn_PER_type_NGAP_WarningAreaCoordinates_constr_1,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
NGAP_WarningAreaCoordinates_constraint
},
0, 0, /* No members */
&asn_SPC_OCTET_STRING_specs /* Additional specs */
};
|
/*------------------------------------------------------------------
* wmemcmp_s.c - Compares memory
*
* September 2014, D. Wheeler
*
* Copyright (c) 2014 Intel Corp
* All rights reserved.
*
* Based on memcmp32_s.c, October 2008, by Bo Berry
*
* 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 "safeclib_private.h"
#include "safe_mem_constraint.h"
#include "safe_mem_lib.h"
/**
* NAME
* wmemcmp_s
*
* SYNOPSIS
* #include "safe_mem_lib.h"
* errno_t
* wmemcmp_s(const wchar_t *dest, rsize_t dmax,
* const wchar_t *src, rsize_t smax, int *diff)
*
* DESCRIPTION
* Compares wide-character strings until they differ, and their difference is
* returned in diff. If the wide character string is the same, diff=0.
*
* EXTENSION TO
* ISO/IEC JTC1 SC22 WG14 N1172, Programming languages, environments
* and system software interfaces, Extensions to the C Library,
* Part I: Bounds-checking interfaces
*
* INPUT PARAMETERS
* dest pointer to memory to compare against
*
* dmax maximum length of dest, in uint32_t
*
* src pointer to the source memory to compare with dest
*
* smax maximum length of src, in uint32_t
*
* *diff pointer to the diff which is an integer greater
* than, equal to or less than zero according to
* whether the object pointed to by dest is
* greater than, equal to or less than the object
* pointed to by src.
*
* OUTPUT PARAMETERS
* none
*
* RUNTIME CONSTRAINTS
* Neither dest nor src shall be a null pointer.
* Neither dmax nor smax shall be zero.
* dmax shall not be greater than RSIZE_MAX_MEM.
* smax shall not be greater than dmax.
*
* RETURN VALUE
* EOK successful operation
* ESNULLP NULL pointer
* ESZEROL zero length
* ESLEMAX length exceeds max limit
*
* ALSO SEE
* memcmp_s(), memcmp16_s()
*
*/
errno_t
wmemcmp_s (const wchar_t *dest, rsize_t dmax,
const wchar_t *src, rsize_t smax, int *diff)
{
/*
* must be able to return the diff
*/
if (diff == NULL) {
invoke_safe_mem_constraint_handler("wmemcmp_s: diff is null",
NULL, ESNULLP);
return (RCNEGATE(ESNULLP));
}
*diff = -1; /* default diff */
if (dest == NULL) {
invoke_safe_mem_constraint_handler("wmemcmp_s: dest is null",
NULL, ESNULLP);
return (RCNEGATE(ESNULLP));
}
if (src == NULL) {
invoke_safe_mem_constraint_handler("wmemcmp_s: src is null",
NULL, ESNULLP);
return (RCNEGATE(ESNULLP));
}
if (dmax == 0) {
invoke_safe_mem_constraint_handler("wmemcmp_s: dmax is 0",
NULL, ESZEROL);
return (RCNEGATE(ESZEROL));
}
if (dmax > RSIZE_MAX_MEM32) {
invoke_safe_mem_constraint_handler("wmemcmp_s: dmax exceeds max",
NULL, ESLEMAX);
return (RCNEGATE(ESLEMAX));
}
if (smax == 0) {
invoke_safe_mem_constraint_handler("wmemcmp_s: smax is 0",
NULL, ESZEROL);
return (RCNEGATE(ESZEROL));
}
if (smax > dmax) {
invoke_safe_mem_constraint_handler("wmemcmp_s: smax exceeds dmax",
NULL, ESLEMAX);
return (RCNEGATE(ESLEMAX));
}
/*
* no need to compare the same memory
*/
if (dest == src) {
*diff = 0;
return (RCNEGATE(EOK));
}
/*
* now compare src to dest
*/
*diff = 0;
while (dmax != 0 && smax != 0) {
if (*dest != *src) {
*diff = *dest - *src;
break;
}
dmax--;
smax--;
dest++;
src++;
}
return (RCNEGATE(EOK));
}
EXPORT_SYMBOL(wmemcmp_s)
|
/*
* Copyright (c) 2007-2010 Digital Bazaar, Inc. All rights reserved.
*/
#ifndef bitmunk_bfp_BfpModule_H
#define bitmunk_bfp_BfpModule_H
#include "bitmunk/node/BitmunkModule.h"
#include "bitmunk/bfp/IBfpModule.h"
// module logging category
extern monarch::logging::Category* BM_BFP_CAT;
namespace bitmunk
{
namespace bfp
{
/**
* A BfpModule is a NodeModule that provides an interface for creating
* and freeing Bfp objects. A Bfp object is used to assign IDs for Wares,
* FileInfos, and FilePieces and for watermarking, encrypting, and decrypting
* data transmitted on Bitmunk.
*
* @author Dave Longley
*/
class BfpModule : public bitmunk::node::BitmunkModule
{
protected:
/**
* Stores the interface instance.
*/
IBfpModule* mInterface;
public:
/**
* Creates a new BfpModule.
*/
BfpModule();
/**
* Destructs this BfpModule.
*/
virtual ~BfpModule();
/**
* Adds additional dependency information. This includes dependencies
* beyond the Bitmunk Node module dependencies.
*
* @param depInfo the dependency information to update.
*/
virtual void addDependencyInfo(monarch::rt::DynamicObject& depInfo);
/**
* Initializes this Module with the passed Node.
*
* @param node the Node.
*
* @return true if initialized, false if an Exception occurred.
*/
virtual bool initialize(bitmunk::node::Node* node);
/**
* Cleans up this Module just prior to its unloading.
*
* @param node the Node.
*/
virtual void cleanup(bitmunk::node::Node* node);
/**
* Gets the API for this NodeModule.
*
* @param node the Node.
*
* @return the API for this NodeModule.
*/
virtual monarch::kernel::MicroKernelModuleApi* getApi(
bitmunk::node::Node* node);
};
} // end namespace bfp
} // end namespace bitmunk
#endif
|
/**
******************************************************************************
* @file LCD_DSI/LCD_DSI_CmdMode_SingleBuffer/Inc/stm32f4xx_it.h
* @author MCD Application Team
* @version V1.0.3
* @date 29-January-2016
* @brief This file contains the headers of the interrupt handlers.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_IT_H
#define __STM32F4xx_IT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void NMI_Handler(void);
void HardFault_Handler(void);
void MemManage_Handler(void);
void BusFault_Handler(void);
void UsageFault_Handler(void);
void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void LTDC_IRQHandler(void);
void LTDC_ER_IRQHandler(void);
void DSI_IRQHandler(void);
#ifdef __cplusplus
}
#endif
#endif /* __STM32F4xx_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs"
* found in "../support/ngap-r16.4.0/38413-g40.asn"
* `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-UPER`
*/
#ifndef _NGAP_MobilityInformation_H_
#define _NGAP_MobilityInformation_H_
#include <asn_application.h>
/* Including external dependencies */
#include <BIT_STRING.h>
#ifdef __cplusplus
extern "C" {
#endif
/* NGAP_MobilityInformation */
typedef BIT_STRING_t NGAP_MobilityInformation_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_NGAP_MobilityInformation_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_NGAP_MobilityInformation;
asn_struct_free_f NGAP_MobilityInformation_free;
asn_struct_print_f NGAP_MobilityInformation_print;
asn_constr_check_f NGAP_MobilityInformation_constraint;
per_type_decoder_f NGAP_MobilityInformation_decode_aper;
per_type_encoder_f NGAP_MobilityInformation_encode_aper;
#ifdef __cplusplus
}
#endif
#endif /* _NGAP_MobilityInformation_H_ */
#include <asn_internal.h>
|
/*********************************************************************************
*
* This file is part of ZelosOnline.
*
* ZelosOnline is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* ZelosOnline is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2013 Rafael Dominguez (npcdoom)
*
*********************************************************************************/
#ifndef __ZELOS_GLOBALD_SHARD_HPP__
#define __ZELOS_GLOBALD_SHARD_HPP__
#include <stdint.h>
#include <string>
#include <vector>
enum SHARD_NOTIFY
{
SHARD_NOTIFY_USR_CNT,
SHARD_NOTIFY_USR_MAX,
SHARD_NOTIFY_STATE
};
struct Shard
{
Shard ()
: connID(0)
{}
bool is_new; /// Flag that indicates if its a new server.
std::string name; /// Server name
uint16_t id; /// Server Identification number.
uint16_t usr_cnt; /// Current users count.
uint16_t usr_max; /// Max number of users spaces available.
uint8_t state; /// Server state (01 - Online, 00 - Check).
uint32_t connID;
};
#endif //__ZELOS_GLOBALD_SHARD_HPP__
|
#ifndef SERVER_SYS_LOGGING_H_
#define SERVER_SYS_LOGGING_H_
#include "util/sstring.h"
enum LogSeverity {
LOG_SILENT = -2, // Log is recoreded but not echoed to immortals (anti-spam)
LOG_NONE = -1, // Empty
LOG_MISC = 0, // Anything not yet defined below
LOG_LOW = 1, // LOW Errors
LOG_FILE = 2, // File io Errors
LOG_BUG = 3, // 'Bugs' and other such reports
LOG_PROC = 4, // Errors regarding mob/obj/room procs
LOG_PIO = 5, // Player Login/Logout reports
LOG_IIO = 6, // Immortal Login/Logout 'additives'
LOG_CLIENT = 7, // Various errors associated with the SneezyMUD Client.
LOG_COMBAT = 8, // Various errors associated with the combat code.
LOG_CHEAT = 9, // Various logs associated with the cheating code.
LOG_FACT = 10, // Various Faction Stuff
LOG_DB = 11, // Database stuff
LOG_MOB = 15, // Errors in Mobiles not yet defined below
LOG_MOB_AI = 16, // Errors in Mobile Logic
LOG_MOB_RS = 17, // Errors in Mobile Response Scripts
LOG_OBJ = 18, // Errors in Objects not yet defined below
LOG_EDIT = 21, // Various 'edit' errors
LOG_MAX = 23, // This is here to prevent unwarrented use of the belows.
LOG_BATOPR = 24, // Batopr only logs
LOG_BRUTIUS = 25, // Brutius only logs
LOG_COSMO = 26, // Cosmo only logs
LOG_MAROR = 27, // Maror only logs
LOG_PEEL = 28, // Peel only logs
LOG_LAPSOS = 29, // Lapsos only logs
LOG_DASH = 30, // Dash only
LOG_ANGUS = 31, // Angus only
LOG_JESUS = 23 // Jesus only
};
extern void vlogf(const LogSeverity, const sstring &);
extern void vlogf_trace(const LogSeverity, const sstring &);
#endif
|
/*
** $Id: lctype.h,v 1.12.1.1 2013/04/12 18:48:47 roberto Exp $
** 'ctype' functions for Lua
** See Copyright Notice in lua.h
*/
#ifndef lctype_h
#define lctype_h
#include "lua.h"
/*
** WARNING: the functions defined here do not necessarily correspond
** to the similar functions in the standard C ctype.h. They are
** optimized for the specific needs of Lua
*/
#if !defined(LUA_USE_CTYPE)
#if 'A' == 65 && '0' == 48
#define LUA_USE_CTYPE 0 // ASCII case: can use its own tables; faster and fixed
#else
#define LUA_USE_CTYPE 1 // must use standard C ctype
#endif
#endif
#if !LUA_USE_CTYPE /* { */
//#include <limits.h>
#include "llimits.h"
#define ALPHABIT 0
#define DIGITBIT 1
#define PRINTBIT 2
#define SPACEBIT 3
#define XDIGITBIT 4
#define MASK(B) (1 << (B))
/*
** add 1 to char to allow index -1 (EOZ)
*/
#define testprop(c, p) (luai_ctype_[(c)+1] & (p))
/*
** 'lalpha' (Lua alphabetic) and 'lalnum' (Lua alphanumeric) both include '_'
*/
#define lislalpha(c) testprop(c, MASK(ALPHABIT))
#define lislalnum(c) testprop(c, (MASK(ALPHABIT) | MASK(DIGITBIT)))
#define lisdigit(c) testprop(c, MASK(DIGITBIT))
#define lisspace(c) testprop(c, MASK(SPACEBIT))
#define lisprint(c) testprop(c, MASK(PRINTBIT))
#define lisxdigit(c) testprop(c, MASK(XDIGITBIT))
/*
** this 'ltolower' only works for alphabetic characters
*/
#define ltolower(c) ((c) | ('A' ^ 'a'))
/* two more entries for 0 and -1 (EOZ) */
LUAI_DDEC const lu_byte luai_ctype_[UCHAR_MAX + 2];
#else /* }{ */
/*
** use standard C ctypes
*/
//#include <ctype.h>
#define lislalpha(c) (isalpha(c) || (c) == '_')
#define lislalnum(c) (isalnum(c) || (c) == '_')
#define lisdigit(c) (isdigit(c))
#define lisspace(c) (isspace(c))
#define lisprint(c) (isprint(c))
#define lisxdigit(c) (isxdigit(c))
#define ltolower(c) (tolower(c))
#endif /* } */
#endif
|
//
// Copyright 2010-2015 Jacob Dawid <jacob@omg-it.works>
//
// This file is part of QtWebServer.
//
// QtWebServer is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// QtWebServer is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public
// License along with QtWebServer.
// If not, see <http://www.gnu.org/licenses/>.
//
// It is possible to obtain a commercial license of QtWebServer.
// Please contact Jacob Dawid <jacob@omg-it.works>
//
#pragma once
// Own includes
#include "httpresource.h"
// Qt includes
#include <QIODevice>
namespace QtWebServer {
namespace Http {
/**
* @class IODeviceResource
* @author Jacob Dawid
* Links a resource with an io device, for example a QFile.
*/
class IODeviceResource :
public Resource {
Q_OBJECT
public:
IODeviceResource(QString uniqueIdentifier,
QIODevice *ioDevice,
QObject *parent = 0);
~IODeviceResource();
virtual void deliver(const Request& request, Response& response);
private:
QIODevice *_ioDevice;
};
} // Http
} // QtWebServer
|
#include <stdio.h>
#include "../include/libsimplelog_level.h"
#define LOG_LEVEL LOG_LEVEL_DEBUG
#include "../include/libsimplelog.h"
int main() {
LogSetLevel(NULL, Info);
LogTrace("This should compile away");
LogDebug("This should not show");
LogInfo("This should show on stderr");
LogSetOutputFile(NULL, stdout);
LogTrace("This should compile away");
LogDebug("This should not show");
LogInfo("This should show on stdout");
LogSetLevel(NULL, Warn);
LogInfo("Generate a compile time warning: %s", 5);
LogInit();
return 0;
}
|
/**
* Copyright 2016 The Open Source Research Group,
* University of Erlangen-Nürnberg
*
* Licensed under the GNU AFFERO GENERAL PUBLIC LICENSE, Version 3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/gpl.html
*
* 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 __DOIP_PAYLOAD_0000_H
#define __DOIP_PAYLOAD_0000_H
#include "doip-header.h"
void
register_proto_doip_payload_0000(gint proto_doip);
void
dissect_payload_0000(doip_header *, proto_item *, packet_info *pinfo);
#endif /* __DOIP_PAYLOAD_0000_H */
|
// This file is part of the HörTech Open Master Hearing Aid (openMHA)
// Copyright © 2005 2013 2016 2017 2018 HörTech gGmbH
//
// openMHA is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// openMHA is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License, version 3 for more details.
//
// You should have received a copy of the GNU Affero General Public License,
// version 3 along with openMHA. If not, see <http://www.gnu.org/licenses/>.
#include "mha.hh"
#include "mha_error.hh"
#include "mha_errno.h"
#include "mha_parser.hh"
/*
* Local Variables:
* mode: c++
* coding: utf-8-unix
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/
|
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by EditorEngine.rc
//
#define IDS_PROJNAME 100
#define IDR_EDITORENGINE 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 301
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
#define _APS_NEXT_SYMED_VALUE 102
#endif
#endif
|
/*
* Copyright (C) 2010, 2013 Red Hat, Inc.
* Copyright IBM Corp. 2008
*
* lxc_conf.h: header file for linux container config functions
*
* 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, see
* <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "internal.h"
#include "libvirt_internal.h"
#include "domain_conf.h"
#include "domain_event.h"
#include "capabilities.h"
#include "virthread.h"
#include "security/security_manager.h"
#include "configmake.h"
#include "vircgroup.h"
#include "virsysinfo.h"
#include "virusb.h"
#include "virclosecallbacks.h"
#include "virhostdev.h"
#define LXC_DRIVER_NAME "LXC"
#define LXC_CONFIG_DIR SYSCONFDIR "/libvirt/lxc"
#define LXC_STATE_DIR LOCALSTATEDIR "/run/libvirt/lxc"
#define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc"
#define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
typedef struct _virLXCDriver virLXCDriver;
typedef virLXCDriver *virLXCDriverPtr;
typedef struct _virLXCDriverConfig virLXCDriverConfig;
typedef virLXCDriverConfig *virLXCDriverConfigPtr;
struct _virLXCDriverConfig {
virObject parent;
char *configDir;
char *autostartDir;
char *stateDir;
char *logDir;
bool log_libvirtd;
int have_netns;
char *securityDriverName;
bool securityDefaultConfined;
bool securityRequireConfined;
};
struct _virLXCDriver {
virMutex lock;
/* Require lock to get reference on 'config',
* then lockless thereafter */
virLXCDriverConfigPtr config;
/* pid file FD, ensures two copies of the driver can't use the same root */
int lockFD;
/* Require lock to get a reference on the object,
* lockless access thereafter */
virCapsPtr caps;
/* Immutable pointer, Immutable object */
virDomainXMLOptionPtr xmlopt;
/* Immutable pointer, lockless APIs*/
virSysinfoDefPtr hostsysinfo;
/* Atomic inc/dec only */
unsigned int nactive;
/* Immutable pointers. Caller must provide locking */
virStateInhibitCallback inhibitCallback;
void *inhibitOpaque;
/* Immutable pointer, self-locking APIs */
virDomainObjListPtr domains;
virHostdevManagerPtr hostdevMgr;
/* Immutable pointer, self-locking APIs */
virObjectEventStatePtr domainEventState;
/* Immutable pointer. self-locking APIs */
virSecurityManagerPtr securityManager;
/* Immutable pointer, self-locking APIs */
virCloseCallbacksPtr closeCallbacks;
};
virLXCDriverConfigPtr virLXCDriverConfigNew(void);
virLXCDriverConfigPtr virLXCDriverGetConfig(virLXCDriverPtr driver);
int virLXCLoadDriverConfig(virLXCDriverConfigPtr cfg,
const char *filename);
virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver);
virCapsPtr virLXCDriverGetCapabilities(virLXCDriverPtr driver,
bool refresh);
virDomainXMLOptionPtr lxcDomainXMLConfInit(void);
static inline void lxcDriverLock(virLXCDriverPtr driver)
{
virMutexLock(&driver->lock);
}
static inline void lxcDriverUnlock(virLXCDriverPtr driver)
{
virMutexUnlock(&driver->lock);
}
|
/*!
* \file DGColumnHeatDispersion.h
* \brief Discontinous Galerkin kernel for energy dispersion in a fixed-bed column
* \details This file creates a discontinous Galerkin kernel for the dispersive heat transfer in a fixed-bed column.
* The dispersion portion of the energy transport equations involves the thermal conductivity in the system.
* That parameter is calculated in a material properties file and passed into this object for use the construction
* of residuals and Jacobians.
*
* \note Any DG kernel under DGOSPREY will have a cooresponding G kernel (usually of same name) that must be included
* with the DG kernel in the input file. This is because the DG finite element method breaks into several different
* residual pieces, only a handful of which are handled by the DG kernel system and the other parts must be handled
* by the standard Galerkin system. This my be due to some legacy code in MOOSE. I am not sure if it is possible to
* lump all of these actions into a single DG kernel.
*
* \author Austin Ladshaw
* \date 11/20/2015
* \copyright This kernel was designed and built at the Georgia Institute
* of Technology by Austin Ladshaw for PhD research in the area
* of adsorption and surface science and was developed for use
* by Idaho National Laboratory and Oak Ridge National Laboratory
* engineers and scientists. Portions Copyright (c) 2015, all
* rights reserved.
*
* Austin Ladshaw does not claim any ownership or copyright to the
* MOOSE framework in which these kernels are constructed, only
* the kernels themselves. The MOOSE framework copyright is held
* by the Battelle Energy Alliance, LLC (c) 2010, all rights reserved.
*/
/****************************************************************/
/* 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 */
/****************************************************************/
#include "DGAnisotropicDiffusion.h"
#ifndef DGCOLUMNHEATDISPERSION_H
#define DGCOLUMNHEATDISPERSION_H
/// DGColumnHeatDispersion class object forward declarations
class DGColumnHeatDispersion;
template<>
InputParameters validParams<DGColumnHeatDispersion>();
/// DGColumnHeatDispersion class object inherits from DGAnisotropicDiffusion object
/** This class object inherits from the DGAnisotropicDiffusion object in OSPREY.
All public and protected members of this class are required function overrides. The object
will provide residuals and Jacobians for the discontinous Galerkin formulation of the heat
dispersion physics in a fixed-bed column. Parameters for this kernel are given as material
properties and will be used to override the inherited classes diffusion tensor.
\note As a reminder, any DGKernel in MOOSE was be accompanied by the equivalent GKernel in
order to provide the full residuals and Jacobians for the system. */
class DGColumnHeatDispersion : public DGAnisotropicDiffusion
{
public:
/// Required constructor for objects in MOOSE
DGColumnHeatDispersion(const InputParameters & parameters);
protected:
/// Required residual function for DG kernels in MOOSE
/** This function returns a residual contribution for this object.*/
virtual Real computeQpResidual(Moose::DGResidualType type);
/// Required Jacobian function for DG kernels in MOOSE
/** This function returns a Jacobian contribution for this object. The Jacobian being
computed is the associated diagonal element in the overall Jacobian matrix for the
system and is used in preconditioning of the linear sub-problem. */
virtual Real computeQpJacobian(Moose::DGJacobianType type);
private:
const MaterialProperty<Real> & _conductivity; ///< Reference to the thermal conductivity material property
};
#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 Qt Designer 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 PLUGINDIALOG_H
#define PLUGINDIALOG_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "ui_plugindialog.h"
QT_BEGIN_NAMESPACE
class QDesignerFormEditorInterface;
namespace qdesigner_internal {
class PluginDialog : public QDialog
{
Q_OBJECT
public:
explicit PluginDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
private slots:
void updateCustomWidgetPlugins();
private:
void populateTreeWidget();
QIcon pluginIcon(const QIcon &icon);
QTreeWidgetItem* setTopLevelItem(const QString &itemName);
QTreeWidgetItem* setPluginItem(QTreeWidgetItem *topLevelItem,
const QString &itemName, const QFont &font);
void setItem(QTreeWidgetItem *pluginItem, const QString &name,
const QString &toolTip, const QString &whatsThis, const QIcon &icon);
QDesignerFormEditorInterface *m_core;
Ui::PluginDialog ui;
QIcon interfaceIcon;
QIcon featureIcon;
};
}
QT_END_NAMESPACE
#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 QMOTIFSTYLE_P_H
#define QMOTIFSTYLE_P_H
#include <qlist.h>
#include <qdatetime.h>
#include <qprogressbar.h>
#include "qmotifstyle.h"
#include "qcommonstyle_p.h"
QT_BEGIN_NAMESPACE
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
// file may change from version to version without notice, or even be removed.
//
// We mean it.
//
// Private class
class QMotifStylePrivate : public QCommonStylePrivate
{
Q_DECLARE_PUBLIC(QMotifStyle)
public:
QMotifStylePrivate();
public:
#ifndef QT_NO_PROGRESSBAR
QList<QProgressBar *> bars;
int animationFps;
int animateTimer;
QTime startTime;
int animateStep;
#endif // QT_NO_PROGRESSBAR
};
QT_END_NAMESPACE
#endif //QMOTIFSTYLE_P_H
|
/*
* Copyright (C) 2017 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @{
*
* @file
* @brief Implements various POSIX syscalls
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
*/
#include <errno.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <unistd.h>
#include "irq.h"
#ifdef MODULE_VFS
#include <fcntl.h>
#include "vfs.h"
#elif defined(MODULE_STDIO_UART)
#include "stdio_uart.h"
#endif
int open(const char *name, int flags, ...)
{
#ifdef MODULE_VFS
unsigned mode = 0;
if ((flags & O_CREAT)) {
va_list ap;
va_start(ap, flags);
mode = va_arg(ap, unsigned);
va_end(ap);
}
int fd = vfs_open(name, flags, mode);
if (fd < 0) {
/* vfs returns negative error codes */
errno = -fd;
return -1;
}
return fd;
#else
(void)name;
(void)flags;
errno = ENODEV;
return -1;
#endif
}
int close(int fd)
{
#ifdef MODULE_VFS
int res = vfs_close(fd);
if (res < 0) {
errno = -res;
return -1;
}
return res;
#else
(void)fd;
errno = ENODEV;
return -1;
#endif
}
off_t lseek(int fd, off_t off, int whence)
{
#ifdef MODULE_VFS
off_t res = vfs_lseek(fd, off, whence);
if (res < 0) {
errno = -res;
return -1;
}
return res;
#else
(void)fd;
(void)off;
(void)whence;
errno = ENODEV;
return -1;
#endif
}
int fcntl(int fd, int cmd, ...)
{
#ifdef MODULE_VFS
unsigned long arg;
va_list ap;
va_start(ap, cmd);
arg = va_arg(ap, unsigned long);
va_end(ap);
int res = vfs_fcntl(fd, cmd, arg);
if (res < 0) {
errno = -res;
return -1;
}
return res;
#else
(void)fd;
(void)cmd;
errno = ENODEV;
return -1;
#endif
}
int fstat(int fd, struct stat *buf)
{
#ifdef MODULE_VFS
int res = vfs_fstat(fd, buf);
if (res < 0) {
errno = -res;
return -1;
}
return res;
#else
(void)fd;
(void)buf;
errno = ENODEV;
return -1;
#endif
}
ssize_t read(int fd, void *dest, size_t count)
{
#ifdef MODULE_VFS
ssize_t res = vfs_read(fd, dest, count);
if (res < 0) {
errno = -res;
return -1;
}
return res;
#elif defined(MODULE_STDIO_UART)
if (fd == 0) {
return stdio_read(dest, count);
}
errno = EBADF;
return -1;
#else
(void)fd;
(void)dest;
(void)count;
errno = ENODEV;
return -1;
#endif
}
ssize_t write(int fd, const void *src, size_t count)
{
#ifdef MODULE_VFS
ssize_t res = vfs_write(fd, src, count);
if (res < 0) {
errno = -res;
return -1;
}
return res;
#elif defined(MODULE_STDIO_UART)
if (fd == 0) {
return stdio_write(src, count);
}
errno = EBADF;
return -1;
#else
(void)fd;
(void)src;
(void)count;
errno = ENODEV;
return -1;
#endif
}
/** @} */
|
/**********************************************************************
* $Id: PolygonizeDirectedEdge.h 1820 2006-09-06 16:54:23Z mloskot $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2006 Refractions Research Inc.
* Copyright (C) 2001-2002 Vivid Solutions Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#ifndef GEOS_OP_POLYGONIZE_POLYGONIZEDIRECTEDEDGE_H
#define GEOS_OP_POLYGONIZE_POLYGONIZEDIRECTEDEDGE_H
#include <geos/planargraph/DirectedEdge.h> // for inheritance
// Forward declarations
namespace geos {
namespace geom {
//class LineString;
}
namespace planargraph {
class Node;
}
namespace operation {
namespace polygonize {
class EdgeRing;
}
}
}
namespace geos {
namespace operation { // geos::operation
namespace polygonize { // geos::operation::polygonize
/** \brief
* A DirectedEdge of a PolygonizeGraph, which represents
* an edge of a polygon formed by the graph.
*
* May be logically deleted from the graph by setting the
* <code>marked</code> flag.
*/
class PolygonizeDirectedEdge: public planargraph::DirectedEdge {
private:
EdgeRing *edgeRing;
PolygonizeDirectedEdge *next;
long label;
public:
/*
* \brief
* Constructs a directed edge connecting the <code>from</code> node
* to the <code>to</code> node.
*
* @param directionPt
* specifies this DirectedEdge's direction (given by an imaginary
* line from the <code>from</code> node to <code>directionPt</code>)
*
* @param edgeDirection
* whether this DirectedEdge's direction is the same as or
* opposite to that of the parent Edge (if any)
*/
PolygonizeDirectedEdge(planargraph::Node *newFrom,
planargraph::Node *newTo,
const geom::Coordinate& newDirectionPt,
bool nEdgeDirection);
/*
* Returns the identifier attached to this directed edge.
*/
long getLabel() const;
/*
* Attaches an identifier to this directed edge.
*/
void setLabel(long newLabel);
/*
* Returns the next directed edge in the EdgeRing that this
* directed edge is a member of.
*/
PolygonizeDirectedEdge* getNext() const;
/*
* Sets the next directed edge in the EdgeRing that this
* directed edge is a member of.
*/
void setNext(PolygonizeDirectedEdge *newNext);
/*
* Returns the ring of directed edges that this directed edge is
* a member of, or null if the ring has not been set.
* @see #setRing(EdgeRing)
*/
bool isInRing() const;
/*
* Sets the ring of directed edges that this directed edge is
* a member of.
*/
void setRing(EdgeRing *newEdgeRing);
};
} // namespace geos::operation::polygonize
} // namespace geos::operation
} // namespace geos
#endif // GEOS_OP_POLYGONIZE_POLYGONIZEDIRECTEDEDGE_H
/**********************************************************************
* $Log$
* Revision 1.1 2006/03/22 11:19:06 strk
* opPolygonize.h headers split.
*
**********************************************************************/
|
/*
* lxc: linux Container library
*
* Authors:
* Dongsheng Yang <yangds.fnst@cn.fujitsu.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
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <libgen.h>
#include <string.h>
#include <limits.h>
#include <lxc/lxccontainer.h>
#include "utils.h"
#include "lxc.h"
#include "log.h"
#include "arguments.h"
#if HAVE_IFADDRS_H
#include <ifaddrs.h>
#else
#include <../include/ifaddrs.h>
#endif
lxc_log_define(lxc_device, lxc);
static const struct option my_longopts[] = {
LXC_COMMON_OPTIONS
};
static struct lxc_arguments my_args = {
.progname = "lxc-device",
.help = "\
--name=NAME -- add|del DEV\n\
\n\
lxc-device attach or detach DEV to or from container.\n\
\n\
Options :\n\
-n, --name=NAME NAME for name of the container",
.options = my_longopts,
.parser = NULL,
.checker = NULL,
};
static bool is_interface(const char* dev_name, pid_t pid)
{
pid_t p = fork();
if (p < 0) {
SYSERROR("failed to fork task.");
exit(1);
}
if (p == 0) {
struct ifaddrs *interfaceArray = NULL, *tempIfAddr = NULL;
if (!switch_to_ns(pid, "net")) {
ERROR("failed to enter netns of container.");
exit(-1);
}
/* Grab the list of interfaces */
if (getifaddrs(&interfaceArray)) {
ERROR("failed to get interfaces list");
exit(-1);
}
/* Iterate through the interfaces */
for (tempIfAddr = interfaceArray; tempIfAddr != NULL; tempIfAddr = tempIfAddr->ifa_next) {
if (strcmp(tempIfAddr->ifa_name, dev_name) == 0) {
exit(0);
}
}
exit(1);
}
if (wait_for_pid(p) == 0) {
return true;
}
return false;
}
int main(int argc, char *argv[])
{
struct lxc_container *c;
const char *cmd, *dev_name, *dst_name;
int ret = 1;
if (geteuid() != 0) {
ERROR("%s must be run as root", argv[0]);
exit(1);
}
if (lxc_arguments_parse(&my_args, argc, argv))
goto err;
if (!my_args.log_file)
my_args.log_file = "none";
if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]))
goto err;
lxc_log_options_no_override();
c = lxc_container_new(my_args.name, my_args.lxcpath[0]);
if (!c) {
ERROR("%s doesn't exist", my_args.name);
goto err;
}
if (!c->is_running(c)) {
ERROR("Container %s is not running.", c->name);
goto err1;
}
if (my_args.argc < 2) {
ERROR("Error: no command given (Please see --help output)");
goto err1;
}
cmd = my_args.argv[0];
dev_name = my_args.argv[1];
if (my_args.argc < 3)
dst_name = dev_name;
else
dst_name = my_args.argv[2];
if (strcmp(cmd, "add") == 0) {
if (is_interface(dev_name, 1)) {
ret = c->attach_interface(c, dev_name, dst_name);
} else {
ret = c->add_device_node(c, dev_name, dst_name);
}
if (ret != true) {
ERROR("Failed to add %s to %s.", dev_name, c->name);
ret = 1;
goto err1;
}
INFO("Add %s to %s.", dev_name, c->name);
} else if (strcmp(cmd, "del") == 0) {
if (is_interface(dev_name, c->init_pid(c))) {
ret = c->detach_interface(c, dev_name, dst_name);
} else {
ret = c->remove_device_node(c, dev_name, dst_name);
}
if (ret != true) {
ERROR("Failed to del %s from %s.", dev_name, c->name);
ret = 1;
goto err1;
}
INFO("Delete %s from %s.", dev_name, c->name);
} else {
ERROR("Error: Please use add or del (Please see --help output)");
goto err1;
}
exit(0);
err1:
lxc_container_put(c);
err:
exit(ret);
}
|
/*
Copyright (C) 2012 Fredrik Johansson
This file is part of Arb.
Arb is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include "arb_poly.h"
int main()
{
slong iter;
flint_rand_t state;
flint_printf("interpolate_newton....");
fflush(stdout);
flint_randinit(state);
for (iter = 0; iter < 10000 * arb_test_multiplier(); iter++)
{
slong i, n, qbits1, qbits2, rbits1, rbits2, rbits3;
fmpq_poly_t P;
arb_poly_t R, S;
fmpq_t t, u;
arb_ptr xs, ys;
fmpq_poly_init(P);
arb_poly_init(R);
arb_poly_init(S);
fmpq_init(t);
fmpq_init(u);
qbits1 = 2 + n_randint(state, 200);
qbits2 = 2 + n_randint(state, 5);
rbits1 = 2 + n_randint(state, 200);
rbits2 = 2 + n_randint(state, 200);
rbits3 = 2 + n_randint(state, 200);
fmpq_poly_randtest(P, state, 1 + n_randint(state, 20), qbits1);
n = P->length;
xs = _arb_vec_init(n);
ys = _arb_vec_init(n);
arb_poly_set_fmpq_poly(R, P, rbits1);
if (n > 0)
{
fmpq_randtest(t, state, qbits2);
arb_set_fmpq(xs, t, rbits2);
for (i = 1; i < n; i++)
{
fmpq_randtest_not_zero(u, state, qbits2);
fmpq_abs(u, u);
fmpq_add(t, t, u);
arb_set_fmpq(xs + i, t, rbits2);
}
}
for (i = 0; i < n; i++)
arb_poly_evaluate(ys + i, R, xs + i, rbits2);
arb_poly_interpolate_newton(S, xs, ys, n, rbits3);
if (!arb_poly_contains_fmpq_poly(S, P))
{
flint_printf("FAIL:\n");
flint_printf("P = "); fmpq_poly_print(P); flint_printf("\n\n");
flint_printf("R = "); arb_poly_printd(R, 15); flint_printf("\n\n");
flint_printf("S = "); arb_poly_printd(S, 15); flint_printf("\n\n");
abort();
}
fmpq_poly_clear(P);
arb_poly_clear(R);
arb_poly_clear(S);
fmpq_clear(t);
fmpq_clear(u);
_arb_vec_clear(xs, n);
_arb_vec_clear(ys, n);
}
flint_randclear(state);
flint_cleanup();
flint_printf("PASS\n");
return EXIT_SUCCESS;
}
|
#include <bonobo/bonobo-main.h>
#include <stdlib.h>
#include <libebook/e-book.h>
int
main (int argc, char **argv)
{
EContact *contact;
EContactDate date, *dp;
if (bonobo_init (&argc, argv) == FALSE)
g_error ("Could not initialize Bonobo");
contact = e_contact_new ();
date.year = 1999;
date.month = 3;
date.day = 3;
e_contact_set (contact, E_CONTACT_BIRTH_DATE, &date);
printf ("vcard = \n%s\n", e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30));
dp = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
if (dp->year != date.year
|| dp->month != date.month
|| dp->day != date.day)
printf ("failed\n");
else
printf ("passed\n");
return 0;
}
|
#pragma once
#include <string>
#include <map>
#include "StatefulFeatureFunction.h"
#include "FFState.h"
#include "moses/Phrase.h"
namespace Moses
{
enum ControlRecombinationType {
// when to recombine
SameOutput = 1,
Never = 2
};
class ControlRecombination;
class ControlRecombinationState : public FFState
{
public:
ControlRecombinationState(const ControlRecombination &ff)
:m_ff(ff) {
}
ControlRecombinationState(const Hypothesis &hypo, const ControlRecombination &ff);
ControlRecombinationState(const ChartHypothesis &hypo, const ControlRecombination &ff);
int Compare(const FFState& other) const;
const Phrase &GetPhrase() const {
return m_outputPhrase;
}
protected:
Phrase m_outputPhrase;
const ControlRecombination &m_ff;
const void *m_hypo;
};
//////////////////////////////////////////////////////////////////
// only allow recombination for the same output
class ControlRecombination : public StatefulFeatureFunction
{
public:
ControlRecombination(const std::string &line)
:StatefulFeatureFunction(0, line)
,m_type(SameOutput)
{
m_tuneable = false;
ReadParameters();
}
bool IsUseable(const FactorMask &mask) const {
return true;
}
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedFutureScore) const {
}
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const {
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const {
}
FFState* EvaluateWhenApplied(
const Hypothesis& cur_hypo,
const FFState* prev_state,
ScoreComponentCollection* accumulator) const;
FFState* EvaluateWhenApplied(
const ChartHypothesis& /* cur_hypo */,
int /* featureID - used to index the state in the previous hypotheses */,
ScoreComponentCollection* accumulator) const;
virtual const FFState* EmptyHypothesisState(const InputType &input) const {
return new ControlRecombinationState(*this);
}
std::vector<float> DefaultWeights() const;
void SetParameter(const std::string& key, const std::string& value);
ControlRecombinationType GetType() const {
return m_type;
}
protected:
ControlRecombinationType m_type;
};
}
|
#include <stdio.h>
#include <stdlib.h>
#include "enemy.h"
#include "util.h"
#define COLOR_MAGENTA "\033[35m" /* Magenta */
#define COLOR_RESET "\033[0m"
void Enemy_Init(Enemy* e)
{
e->heading = e->distance = 0;
e->alive = false;
Torpedo_Init(&e->torpedo);
}
void Enemy_Spawn(Enemy* e)
{
e->heading = (rand() % 24) * 15;
e->distance = 20 * BinomialDistribution(10, 60);
e->alive = true;
Torpedo_Init(&e->torpedo);
printf(COLOR_MAGENTA "[SONAR]: Enemy contact has been spotted." COLOR_RESET "\n");
}
|
/***************************************************************************
* Copyright (C) 2003 by Hans Karlsson *
* karlsson.h@home.se *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef SENSOR_H
#define SENSOR_H
#include <QTimer>
#include "sensorparams.h"
class Sensor : public QObject
{
Q_OBJECT
public:
Sensor(int msec = 1000);
void start();
virtual ~Sensor();
void addMeter(SensorParams *s);
SensorParams* hasMeter(const Meter *meter) const;
void deleteMeter(Meter *meter);
int isEmpty()
{
return objList->isEmpty();
}
virtual void setMaxValue(SensorParams *s);
private:
int msec;
QTimer timer;
protected:
QList <QObject*> *objList;
public slots:
virtual void update() = 0;
};
#endif // SENSOR_H
|
/*---------------------------------------------------------------------------*\
* OpenSG *
* *
* *
* Copyright (C) 2000-2002 by the OpenSG Forum *
* *
* www.opensg.org *
* *
* contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
* *
\*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*\
* License *
* *
* 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, version 2. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
* *
\*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*\
* Changes *
* *
* *
* *
* *
* *
* *
\*---------------------------------------------------------------------------*/
/*****************************************************************************\
*****************************************************************************
** **
** This file is automatically generated. **
** **
** Any changes made to this file WILL be lost when it is **
** regenerated, which can become necessary at any time. **
** **
*****************************************************************************
\*****************************************************************************/
#ifndef _OSGDEPTHCHUNKFIELDS_H_
#define _OSGDEPTHCHUNKFIELDS_H_
#ifdef __sgi
#pragma once
#endif
#include <OSGConfig.h>
#include <OSGFieldContainerPtr.h>
#include <OSGNodeCoreFieldDataType.h>
#include <OSGSystemDef.h>
#include <OSGStateChunkFields.h>
OSG_BEGIN_NAMESPACE
class DepthChunk;
#if !defined(OSG_DO_DOC) // created as a dummy class, remove to prevent doubles
//! DepthChunkPtr
typedef FCPtr<StateChunkPtr, DepthChunk> DepthChunkPtr;
#endif
#if !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3)
/*! \ingroup GrpSystemFieldTraits
*/
#if !defined(OSG_DOC_DEV_TRAITS)
/*! \hideinhierarchy */
#endif
template <>
struct FieldDataTraits<DepthChunkPtr> :
public FieldTraitsRecurseMapper<DepthChunkPtr, true>
{
static DataType _type;
enum { StringConvertable = 0x00 };
enum { bHasParent = 0x01 };
static DataType &getType (void) { return _type; }
static const char *getSName(void) { return "SFDepthChunkPtr"; }
static const char *getMName(void) { return "MFDepthChunkPtr"; }
};
#if !defined(OSG_DOC_DEV_TRAITS)
/*! \class FieldTraitsRecurseMapper<DepthChunkPtr, true>
\hideinhierarchy
*/
#endif
#endif // !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3)
#if !defined(OSG_DO_DOC) || defined(OSG_DOC_FIELD_TYPEDEFS)
/*! \ingroup GrpSystemFieldSingle */
typedef SField<DepthChunkPtr> SFDepthChunkPtr;
#endif
#ifndef OSG_COMPILEDEPTHCHUNKINST
OSG_DLLEXPORT_DECL1(SField, DepthChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING)
#endif
#if !defined(OSG_DO_DOC) || defined(OSG_DOC_FIELD_TYPEDEFS)
/*! \ingroup GrpSystemFieldMulti */
typedef MField<DepthChunkPtr> MFDepthChunkPtr;
#endif
#ifndef OSG_COMPILEDEPTHCHUNKINST
OSG_DLLEXPORT_DECL1(MField, DepthChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING)
#endif
OSG_END_NAMESPACE
#define OSGDEPTHCHUNKFIELDS_HEADER_CVSID "@(#)$Id: OSGDepthChunkFields.h,v 1.9 2008/06/09 12:28:20 vossg Exp $"
#endif /* _OSGDEPTHCHUNKFIELDS_H_ */
|
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef FORMEXTRACTOR_H
#define FORMEXTRACTOR_H
#include <QtGui/QWidget>
#include <QWebFrame>
#if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
#include "ui_formextractor_mobiles.h"
#else
#include "ui_formextractor.h"
#endif
class FormExtractor : public QWidget
{
Q_OBJECT
public:
FormExtractor(QWidget *parent = 0, Qt::WFlags flags = 0);
~FormExtractor();
public slots:
void submit();
void populateJavaScriptWindowObject();
private:
Ui::Form ui;
};
#endif // FORMEXTRACTOR_H
|
/*
Copyright (C) 2020 Fredrik Johansson
This file is part of Arb.
Arb is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include "acb.h"
void mag_agm(mag_t res, const mag_t x, const mag_t y);
static void
agm_helper(acb_t res, const acb_t a, const acb_t b, slong prec)
{
if (acb_rel_accuracy_bits(b) >= acb_rel_accuracy_bits(a))
{
acb_div(res, a, b, prec);
acb_agm1(res, res, prec);
acb_mul(res, res, b, prec);
}
else
{
acb_div(res, b, a, prec);
acb_agm1(res, res, prec);
acb_mul(res, res, a, prec);
}
}
void
acb_agm(acb_t res, const acb_t a, const acb_t b, slong prec)
{
acb_t t, u, v;
if (!acb_is_finite(a) || !acb_is_finite(b))
{
acb_indeterminate(res);
return;
}
if (acb_is_zero(a) || acb_is_zero(b))
{
acb_zero(res);
return;
}
if (arb_is_zero(acb_imagref(a)) && arb_is_zero(acb_imagref(b)))
{
if (arb_is_nonnegative(acb_realref(a)) && arb_is_nonnegative(acb_realref(b)))
{
arb_agm(acb_realref(res), acb_realref(a), acb_realref(b), prec);
arb_zero(acb_imagref(res));
return;
}
}
if (acb_contains_zero(a) || acb_contains_zero(b))
{
mag_t ra, rb;
mag_init(ra);
mag_init(rb);
acb_get_mag(ra, a);
acb_get_mag(rb, b);
mag_agm(ra, ra, rb);
acb_zero(res);
acb_add_error_mag(res, ra);
mag_clear(ra);
mag_clear(rb);
return;
}
acb_init(t);
acb_add(t, a, b, prec);
acb_mul_2exp_si(t, t, -1);
/* a ~= -b; bound magnitude */
if (acb_contains_zero(t))
{
mag_t ra, rb;
mag_init(ra);
mag_init(rb);
acb_get_mag(ra, a);
acb_get_mag(rb, b);
mag_mul(rb, ra, rb);
mag_sqrt(rb, rb);
acb_get_mag(ra, t);
mag_agm(ra, ra, rb);
acb_zero(res);
acb_add_error_mag(res, ra);
mag_clear(ra);
mag_clear(rb);
acb_clear(t);
return;
}
/* Do the initial step with the optimal square root, reducing to agm1 */
acb_init(u);
acb_init(v);
acb_mul(u, a, b, prec);
/* we can compute either square root here; avoid the branch cut */
if (arf_sgn(arb_midref(acb_realref(u))) >= 0)
{
acb_sqrt(u, u, prec);
}
else
{
acb_neg(u, u);
acb_sqrt(u, u, prec);
acb_mul_onei(u, u);
}
acb_div(v, t, u, prec);
if (arb_is_nonnegative(acb_realref(v)))
{
agm_helper(res, t, u, prec);
}
else if (arb_is_negative(acb_realref(v)))
{
acb_neg(u, u);
agm_helper(res, t, u, prec);
}
else
{
agm_helper(v, t, u, prec);
acb_neg(u, u);
agm_helper(res, t, u, prec);
acb_union(res, res, v, prec);
}
acb_clear(t);
acb_clear(u);
acb_clear(v);
}
|
/**
* @file dynrng.h
* A/52 Dynamic Range Compression header
*/
#ifndef DYNRNG_H
#define DYNRNG_H
#include "common.h"
#include "a52.h"
#if 0
void a52_dynrng_init(void);
#endif
int a52_dynrng_calc_block(double *samples[A52_MAX_CHANNELS], int num_ch,
int dialnorm, DynRngProfile profile);
#endif
|
/*
* Copyright (C) 2007 Tommi Maekitalo
*
* 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.
*
* As a special exception, you may use this file as part of a free
* software library without restriction. Specifically, if other files
* instantiate templates or use macros or inline functions from this
* file, or you compile this file and link it with other files to
* produce an executable, this file does not by itself cause the
* resulting executable to be covered by the GNU General Public
* License. This exception does not however invalidate any other
* reasons why the executable file might be covered by the GNU Library
* General Public 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
*/
#ifndef TNT_MIME_H
#define TNT_MIME_H
#include <tnt/component.h>
namespace tnt
{
class MimeHandler;
class Mime : public tnt::Component
{
friend class MimeFactory;
MimeHandler* _handler;
public:
Mime()
: _handler(0)
{ }
~Mime();
virtual void configure(const tnt::TntConfig&);
virtual unsigned operator() (tnt::HttpRequest&, tnt::HttpReply&, tnt::QueryParams&);
};
}
#endif // TNT_MIME_H
|
/*******************************************************************************
* File Name: scsi_data.c
*******************************************************************************/
#include "usb_scsi.h"
#include "memory.h"
u8 Page00_Inquiry_Data[] =
{
0x00, // PERIPHERAL QUALIFIER & PERIPHERAL DEVICE TYPE
0x00,
0x00,
0x00,
0x00 // Supported Pages 00
};
u8 Standard_Inquiry_Data[] =
{
0x00, // Direct Access Device
0x80, // RMB = 1: Removable Medium
0x02, // Version: No conformance claim to standard
0x02,
36 - 4, // Additional Length
0x00, // SCCS = 1: Storage Controller Component
0x00,
0x00,
/* Vendor Identification */
'D', 'S', 'O', ' ', ' ', ' ', ' ', ' ',
/* Product Identification */
'S', 'D', ' ', 'F', 'l', 'a', 's', 'h', ' ',
'D', 'i', 's', 'k', ' ', ' ', ' ',
/* Product Revision Level */
'1', '.', '0', ' '
};
u8 Mode_Sense6_data[] =
{
0x03,
0x00,
0x00,
0x00,
};
u8 Mode_Sense10_data[] =
{
0x00,
0x06,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00
};
u8 Scsi_Sense_Data[] =
{
0x70, //RespCode
0x00, //SegmentNumber
NO_SENSE, //Sens_Key
0x00,
0x00,
0x00,
0x00, //Information
0x0A, //AdditionalSenseLength
0x00,
0x00,
0x00,
0x00, //CmdInformation
NO_SENSE, //Asc
0x00, //ASCQ
0x00, //FRUC
0x00, //TBD
0x00,
0x00 //SenseKeySpecific
};
u8 ReadCapacity10_Data[] =
{
//Last Logical Block
0,
0,
0,
0,
//Block Length
0,
0,
0,
0
};
u8 ReadFormatCapacity_Data [] =
{
0x00,
0x00,
0x00,
0x08, //Capacity List Length
//Block Count
0,
0,
0,
0,
//Block Length
0x02, //Descriptor Code: Formatted Media
0,
0,
0
};
/********************************* END OF FILE ********************************/
|
/****************************************************************************
**
** 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 test suite 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 WAVHEADER_H
#define WAVHEADER_H
#include <QtCore/qobject.h>
#include <QtCore/qfile.h>
#include <qaudioformat.h>
/**
* Helper class for parsing WAV file headers.
*
* See https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
*/
class WavHeader
{
public:
WavHeader(const QAudioFormat &format = QAudioFormat(),
qint64 dataLength = 0);
// Reads WAV header and seeks to start of data
bool read(QIODevice &device);
// Writes WAV header
bool write(QIODevice &device);
const QAudioFormat& format() const;
qint64 dataLength() const;
static qint64 headerLength();
static bool writeDataLength(QIODevice &device, qint64 dataLength);
private:
QAudioFormat m_format;
qint64 m_dataLength;
};
#endif
|
/*
Copyright (C) 2001,2002,2005 Dmitry V. Levin <ldv@altlinux.org>
A privileged helper for utmp/wtmp updates.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <pwd.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <utmp.h>
#ifdef __GLIBC__
# include <pty.h>
#elif defined(__FreeBSD__)
# include <libutil.h>
#else
# error Unsupported platform
#endif /* __GLIBC__ || __FreeBSD__ */
#define DEV_PREFIX "/dev/"
#define DEV_PREFIX_LEN (sizeof(DEV_PREFIX)-1)
static void __attribute__ ((__noreturn__))
usage(void)
{
#ifdef UTEMPTER_DEBUG
fprintf(stderr, "Usage: utempter add [<host>]\n"
" utempter del\n");
#endif
exit(EXIT_FAILURE);
}
static void
validate_device(const char *device)
{
int flags;
struct stat stb;
if (strncmp(device, DEV_PREFIX, DEV_PREFIX_LEN))
{
#ifdef UTEMPTER_DEBUG
fprintf(stderr, "utempter: invalid device name\n");
#endif
exit(EXIT_FAILURE);
}
if ((flags = fcntl(STDIN_FILENO, F_GETFL, 0)) < 0)
{
#ifdef UTEMPTER_DEBUG
fprintf(stderr, "utempter: fcntl: %s\n", strerror(errno));
#endif
exit(EXIT_FAILURE);
}
if ((flags & O_RDWR) != O_RDWR)
{
#ifdef UTEMPTER_DEBUG
fprintf(stderr, "utempter: invalid descriptor mode\n");
#endif
exit(EXIT_FAILURE);
}
if (stat(device, &stb) < 0)
{
#ifdef UTEMPTER_DEBUG
fprintf(stderr, "utempter: %s: %s\n", device,
strerror(errno));
#endif
exit(EXIT_FAILURE);
}
if (getuid() != stb.st_uid)
{
#ifdef UTEMPTER_DEBUG
fprintf(stderr, "utempter: %s belongs to another user\n",
device);
#endif
exit(EXIT_FAILURE);
}
}
static int
write_uwtmp_record(const char *user, const char *term, const char *host,
#ifdef __GLIBC__
pid_t pid,
#endif
int add)
{
struct utmp ut;
struct timeval tv;
#ifdef __GLIBC__
int offset;
#endif
memset(&ut, 0, sizeof(ut));
memset(&tv, 0, sizeof(tv));
(void) gettimeofday(&tv, 0);
strncpy(ut.ut_name, user, sizeof(ut.ut_name));
strncpy(ut.ut_line, term, sizeof(ut.ut_line));
if (host)
strncpy(ut.ut_host, host, sizeof(ut.ut_host));
#ifdef __GLIBC__
offset = strlen(term) - sizeof(ut.ut_id);
if (offset < 0)
offset = 0;
strncpy(ut.ut_id, term + offset, sizeof(ut.ut_id));
if (add)
ut.ut_type = USER_PROCESS;
else
ut.ut_type = DEAD_PROCESS;
ut.ut_pid = pid;
ut.ut_tv.tv_sec = tv.tv_sec;
ut.ut_tv.tv_usec = tv.tv_usec;
setutent();
if (!pututline(&ut))
{
#ifdef UTEMPTER_DEBUG
fprintf(stderr, "utempter: pututline: %s\n", strerror(errno));
#endif
exit(EXIT_FAILURE);
}
endutent();
(void) updwtmp(_PATH_WTMP, &ut);
#elif defined(__FreeBSD__)
ut.ut_time = tv.tv_sec;
if (add)
{
login(&ut);
} else
{
if (logout(term) != 1)
{
#ifdef UTEMPTER_DEBUG
fprintf(stderr, "utempter: logout: %s\n",
strerror(errno));
#endif
exit(EXIT_FAILURE);
}
}
#endif /* __GLIBC__ || __FreeBSD__ */
#ifdef UTEMPTER_DEBUG
fprintf(stderr,
"utempter: DEBUG: utmp/wtmp record %s for terminal '%s'\n",
add ? "added" : "removed", term);
#endif
return EXIT_SUCCESS;
}
int
main(int argc, const char *argv[])
{
const char *device, *host;
struct passwd *pw;
pid_t pid;
int add = 0, i;
for (i = 0; i <= 2; ++i)
{
struct stat sb;
if (fstat(i, &sb) < 0)
/* At this stage, we shouldn't even report error. */
exit(EXIT_FAILURE);
}
if (argc < 2)
usage();
if (!strcmp(argv[1], "add"))
{
if (argc > 3)
usage();
add = 1;
} else if (!strcmp(argv[1], "del"))
{
if (argc != 2)
usage();
add = 0;
} else
usage();
host = argv[2];
pid = getppid();
if (pid == 1)
{
#ifdef UTEMPTER_DEBUG
fprintf(stderr,
"utempter: parent process should not be init\n");
#endif
exit(EXIT_FAILURE);
}
pw = getpwuid(getuid());
if (!pw || !pw->pw_name)
{
#ifdef UTEMPTER_DEBUG
fprintf(stderr,
"utempter: cannot find valid user with uid=%u\n",
getuid());
#endif
exit(EXIT_FAILURE);
}
device = ptsname(STDIN_FILENO);
if (!device)
{
#ifdef UTEMPTER_DEBUG
fprintf(stderr, "utempter: cannot find slave pty: %s\n",
strerror(errno));
#endif
exit(EXIT_FAILURE);
}
validate_device(device);
return write_uwtmp_record(pw->pw_name, device + DEV_PREFIX_LEN, host,
#ifdef __GLIBC__
pid,
#endif
add);
}
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtQml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** 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.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QTQMLGLOBAL_H
#define QTQMLGLOBAL_H
#include <QtCore/qglobal.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef QT_STATIC
# if defined(QT_BUILD_QML_LIB)
# define Q_QML_EXPORT Q_DECL_EXPORT
# else
# define Q_QML_EXPORT Q_DECL_IMPORT
# endif
#else
# define Q_QML_EXPORT
#endif
QT_END_NAMESPACE
QT_END_HEADER
#endif // QTQMLGLOBAL_H
|
/*
Copyright (C) 2001-2008 Ulric Eriksson <ulric@siag.nu>
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 Licence, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include "sdb.h"
#include "common.h"
static int foreground = 0;
static void writedata(int fd, char *b, int n)
{
int i, j;
for (i = 0; i < n; i += j) {
j = write(fd, b+i, n-i);
if (j < 0) sdb_error("Error writing data");
}
}
static void writestring(int fd, char *b)
{
writedata(fd, b, strlen(b));
}
static void waitforchild(int i)
{
if (sdb_debuglevel) sdb_debug("waitforchild()");
waitpid(-1, NULL, WNOHANG);
signal(SIGCHLD, waitforchild);
}
static void chomp(char *p)
{
int i;
for (i = 0; p[i]; i++) {
if (p[i] == '\r' || p[i] == '\n') {
p[i] = '\0';
return;
}
}
}
static int db_callback(int n, char **p, void *closure)
{
int i;
int fd = *((int *)closure);
char b[10];
if (!n) return 0;
sprintf(b, "%d ", n);
writestring(fd, b); /* number of columns */
for (i = 0; i < n; i++) {
char *q = p[i];
if (q == NULL) q = "";
if (sdb_debuglevel > 1) sdb_debug("%s ", q);
sprintf(b, "%ld ", (long)strlen(q));
writestring(fd, b); /* column width */
writestring(fd, q); /* column */
}
if (sdb_debuglevel > 1) sdb_debug("\n");
return 0;
}
static int doquery(int sock, char *u)
{
int n;
char q[4096];
if (sdb_debuglevel) sdb_debug("doquery(%d) begin", sock);
n = read(sock, q, sizeof q);
if (n < 0) sdb_error("Can't read query");
q[n] = '\0';
if (sdb_debuglevel) sdb_debug("'%s'\n", q);
if (sdb_debuglevel) sdb_debug("calling sdb_query");
n = sdb_query(u, q, db_callback, &sock);
writedata(sock, "0", 2); /* The End */
if (sdb_debuglevel) sdb_debug("doquery() end");
return n;
}
static void dourl(int sock)
{
int n;
char u[1024], *db;
if (sdb_debuglevel) sdb_debug("dourl(%d) begin", sock);
n = read(sock, u, sizeof u);
if (n < 0) sdb_error("Can't read URL");
u[n] = '\0';
chomp(u);
if (sdb_debuglevel) sdb_debug("'%s'\n", u);
writedata(sock, " ", 1);
if (!strcmp(u, "sdb_open")) {
n = read(sock, u, sizeof u);
if (n < 0) sdb_error("Can't read URL to open");
u[n] = '\0';
if (sdb_debuglevel) sdb_debug("'%s'\n", u);
chomp(u);
if (sdb_debuglevel) sdb_debug("sdb_open(%s)", u);
db = sdb_open(u);
if (db == NULL) {
writedata(sock, "0", 2);
} else {
writedata(sock, "+0", 2);
}
while (doquery(sock, u) != -1);
sdb_close(db);
} else {
doquery(sock, u);
}
if (sdb_debuglevel) sdb_debug("dourl() end");
}
static void usage(void)
{
printf("usage: sdbd [-df] port\n");
exit(0);
}
static void background(void)
{
int childpid;
if ((childpid = fork()) < 0) {
sdb_error("Can't fork");
} else {
if (childpid > 0) exit(0);
}
setsid();
}
static int options(int argc, char **argv)
{
int c;
while ((c = getopt(argc, argv, "df")) != EOF) {
switch (c) {
case 'd':
sdb_debuglevel++;
break;
case 'f':
foreground = 1;
break;
default:
usage();
}
}
return optind;
}
int main(int argc, char *argv[])
{
int sockfd, newsockfd, port, pid;
struct sockaddr_in serv_addr, cli_addr;
socklen_t clilen;
int one = 1;
int n = options(argc, argv);
argc -= n;
argv += n;
if (argc < 1) {
usage();
}
if (!foreground) background();
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) sdb_error("Error opening socket");
memset((char *) &serv_addr, 0, sizeof(serv_addr));
port = atoi(argv[0]);
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = INADDR_ANY;
serv_addr.sin_port = htons(port);
setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof one);
if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
sdb_error("Error on binding");
listen(sockfd, 5);
clilen = sizeof(cli_addr);
signal(SIGCHLD, waitforchild);
sdb_init();
for (;;) {
if (sdb_debuglevel) sdb_debug("accept(%d, ...)", sockfd);
newsockfd = accept(sockfd,
(struct sockaddr *) &cli_addr, &clilen);
if (newsockfd == -1) {
if (sdb_debuglevel && errno != EINTR) {
sdb_debug("Error on accept");
perror("accept");
}
continue;
}
pid = fork();
if (pid < 0) sdb_error("Error on fork");
if (pid == 0) {
#if 1
close(sockfd);
#endif
dourl(newsockfd);
exit(0);
} else {
close(newsockfd);
}
}
return 0;
}
|
/*
* Copyright (C) 2014 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @ingroup inria_industry_demo
* @{
*
* @file udp.h
* @brief INRIA-Industry 2014 demo application - sensor node
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @}
*/
#ifndef __UDP_H
#define __UDP_H
/**
* @brief UDP shell command handler for starting a UDP server
*/
void udpif_shell_server(int argc, char **argv);
/**
* @brief UDP shell command handler for sending data
*/
void udpif_shell_send(int argc, char **argv);
/**
* @brief Send data via UDP to given local address
*/
int udpif_send(uint16_t dst_addr, uint16_t port, char *data, int length);
/**
* @brief Start a UDP server on the designated port
*/
void udpif_start_server(uint16_t port, void(*ondata)(uint16_t src_addr, char *data, int length));
/**
* @brief Get a full IPv6 address from local address
*/
void udpif_get_ipv6_address(ipv6_addr_t *addr, uint16_t local_addr);
#endif /* __UDP_H */
|
/*
* LFC Library - Linux toolkit
*
* Copyright (C) 2012, 2013 Daniel Mosquera Villanueva
* (milkatoffeecuco@gmail.com)
* This file is part of LFC Library.
*
* 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, see <http://www.gnu.org/licenses/>.
*
**/
#ifndef LFC_H
#define LFC_H
// Libraries needed to compile
// rt, libsqlite3, libx11, libcairo, libpango-1.0, libpangocairo-1.0
// Linker options for backtrace at exceptions
// -rdynamic
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "n_object.h"
#include "exception.h"
#include "nobjectregistry.h"
#include "nchar.h"
#include "nshort.h"
#include "nint.h"
#include "nbool.h"
#include "nlong.h"
#include "nlonglong.h"
#include "nuchar.h"
#include "nushort.h"
#include "nuint.h"
#include "nulong.h"
#include "nulonglong.h"
#include "nfloat.h"
#include "ndouble.h"
#include "nlongdouble.h"
#include "nwchar.h"
#include "random.h"
#include "Delegations/ndelegation.h"
#include "Delegations/ndelegationmanager.h"
#include "Text/text.h"
#include "Text/text_buffer.h"
#include "Text/text_exception.h"
#include "Encoding/locale_encoding.h"
#include "Collections/collection.h"
#include "Collections/collection_exception.h"
#include "Collections/dictionary.h"
#include "Collections/nobjectcollection.h"
#include "Collections/nobjectdictionary.h"
#include "FileSystem/directory.h"
#include "FileSystem/filesystemexception.h"
#include "FileSystem/filesystemobjectinfo.h"
#include "FileSystem/file.h"
#include "FileSystem/ifile.h"
#include "FileSystem/serializator.h"
#include "FileSystem/buffer.h"
#include "Time/datetime.h"
#include "Time/timeexception.h"
#include "Devices/stdout.h"
#include "Devices/stdin.h"
#include "Devices/stderr.h"
#include "Devices/serialport.h"
#include "Devices/deviceexception.h"
#include "System/system.h"
#include "System/systemexception.h"
#include "System/groupinfo.h"
#include "System/userinfo.h"
#include "Math/math.h"
#include "Math/mathexception.h"
#include "Threading/thread.h"
#include "Threading/mutex.h"
#include "Threading/waitcondition.h"
#include "Threading/threadingexception.h"
#include "Threading/mutexlock.h"
#include "Network/ipv4socketaddress.h"
#include "Network/isocketaddress.h"
#include "Network/networkexception.h"
#include "Network/socket.h"
#include "Network/ipv4genericserver.h"
#include "Network/ipv4genericservercontroller.h"
#include "Data/dataexception.h"
#include "Data/sqlite3db.h"
#include "Data/sqlite3statement.h"
#include "Data/sqlite3recordset.h"
#include "XWidgets/xwindow.h"
#include "XWidgets/xdisplay.h"
#include "XWidgets/keysymbols.h"
#include "XWidgets/keycompositionsymbol.h"
#include "XWidgets/xexception.h"
#include "XWidgets/Graphics/igraphics.h"
#include "XWidgets/Graphics/xwindowgraphics.h"
#include "XWidgets/Graphics/pixmapgraphics.h"
#include "XWidgets/Graphics/imagegraphics.h"
#include "XWidgets/Graphics/nsize.h"
#include "XWidgets/Graphics/npoint.h"
#include "XWidgets/Graphics/nrectangle.h"
#include "XWidgets/Graphics/ncolor.h"
#include "XWidgets/Graphics/nfont.h"
#include "XWidgets/Graphics/graphicspattern.h"
#include "XWidgets/Graphics/graphicspatternlinear.h"
#include "XWidgets/Graphics/graphicspatternradial.h"
#include "XWidgets/Events/windoweventmousebutton.h"
#include "XWidgets/Events/windoweventmousemove.h"
#include "XWidgets/Events/windoweventcreate.h"
#include "XWidgets/Events/windoweventdestroy.h"
#include "XWidgets/Events/windowevententerleave.h"
#include "XWidgets/Events/windoweventkey.h"
#include "XWidgets/Events/windoweventfocus.h"
#include "XWidgets/Events/windoweventkeymap.h"
#include "XWidgets/Events/windoweventdraw.h"
#include "XWidgets/Events/windoweventvisible.h"
#include "XWidgets/Events/windoweventshow.h"
#include "XWidgets/Events/windoweventmove.h"
#include "XWidgets/Events/windoweventresize.h"
#include "XWidgets/Events/windoweventkeyboardmapping.h"
#include "XWidgets/Events/windoweventcolormap.h"
#include "XWidgets/Events/controlevent.h"
#include "XWidgets/Events/controleventvisible.h"
#include "XWidgets/Events/controleventfocused.h"
#include "XWidgets/Events/controleventbackcolor.h"
#include "XWidgets/Events/controleventfont.h"
#include "XWidgets/Events/controleventmoved.h"
#include "XWidgets/Events/controleventkey.h"
#include "XWidgets/Events/controleventmouseclick.h"
#include "XWidgets/Events/controleventmousedoubleclick.h"
#include "XWidgets/Events/controleventaction.h"
#include "XWidgets/Events/controleventfocusedcolor.h"
#include "XWidgets/Controls/control.h"
#include "XWidgets/Controls/controllabel.h"
#include "XWidgets/Controls/controlbutton.h"
#include "XWidgets/Controls/controltextbox.h"
#include "XWidgets/Controls/controlexception.h"
void lfc_init();
#endif |
/*
© 2011 CloudSixteen.com do not share, re-distribute or modify
this file without the permission of its owner(s).
*/
#ifndef CPHYSJOINT_H
#define CPHYSJOINT_H
#include <ClanLib/core.h>
#include <Box2D/Box2D.h>
#include "CPhysBody.h"
#include "Lua.h"
class CPhysJoint
{
public:
static void LuaBind(luabind::object& globals);
CPhysBody GetBodyA();
CPhysBody GetBodyB();
CL_Vec2f GetAnchorA();
CL_Vec2f GetAnchorB();
void Destroy();
b2Joint* Object();
CPhysJoint(b2Joint* joint);
CPhysJoint();
~CPhysJoint();
protected:
b2Joint* m_object;
};
#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 Qt Designer 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 QACTIVEXPROPERTYSHEET_H
#define QACTIVEXPROPERTYSHEET_H
#include <QtDesigner/private/qdesigner_propertysheet_p.h>
QT_BEGIN_NAMESPACE
class QDesignerAxWidget;
class QDesignerFormWindowInterface;
/* The propertysheet has a method to delete itself and repopulate
* if the "control" property changes. Pre 4.5, the control property
* might not be the first one, so, the properties are stored and
* re-applied. If the "control" is the first one, it should be
* sufficient to reapply the changed flags, however, care must be taken when
* resetting the control.
* Resetting a control: The current behaviour is that the modified Active X properties are added again
* as Fake-Properties, which is a nice side-effect as not cause a loss. */
class QAxWidgetPropertySheet: public QDesignerPropertySheet
{
Q_OBJECT
Q_INTERFACES(QDesignerPropertySheetExtension)
public:
explicit QAxWidgetPropertySheet(QDesignerAxWidget *object, QObject *parent = 0);
virtual bool isEnabled(int index) const;
virtual void setProperty(int index, const QVariant &value);
virtual bool reset(int index);
int indexOf(const QString &name) const;
bool dynamicPropertiesAllowed() const;
static const char *controlPropertyName;
public slots:
void updatePropertySheet();
private:
QDesignerAxWidget *axWidget() const;
const QString m_controlProperty;
const QString m_propertyGroup;
int m_controlIndex;
struct SavedProperties {
typedef QMap<QString, QVariant> NamePropertyMap;
NamePropertyMap changedProperties;
QWidget *widget;
QString clsid;
} m_currentProperties;
static void reloadPropertySheet(const struct SavedProperties &properties, QDesignerFormWindowInterface *formWin);
};
typedef QDesignerPropertySheetFactory<QDesignerAxWidget, QAxWidgetPropertySheet> ActiveXPropertySheetFactory;
QT_END_NAMESPACE
#endif
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2014 Richard Hughes <richard@hughsie.com>
*
* Licensed under the GNU Lesser General Public License Version 2.1
*
* 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
*/
#if !defined (__APPSTREAM_GLIB_H) && !defined (AS_COMPILATION)
#error "Only <appstream-glib.h> can be included directly."
#endif
#ifndef __AS_BUNDLE_H
#define __AS_BUNDLE_H
#include <glib-object.h>
G_BEGIN_DECLS
#define AS_TYPE_BUNDLE (as_bundle_get_type ())
G_DECLARE_DERIVABLE_TYPE (AsBundle, as_bundle, AS, BUNDLE, GObject)
struct _AsBundleClass
{
GObjectClass parent_class;
/*< private >*/
void (*_as_reserved1) (void);
void (*_as_reserved2) (void);
void (*_as_reserved3) (void);
void (*_as_reserved4) (void);
void (*_as_reserved5) (void);
void (*_as_reserved6) (void);
void (*_as_reserved7) (void);
void (*_as_reserved8) (void);
};
/**
* AsBundleKind:
* @AS_BUNDLE_KIND_UNKNOWN: Type invalid or not known
* @AS_BUNDLE_KIND_LIMBA: Limba application bundle
* @AS_BUNDLE_KIND_XDG_APP: Desktop application deployment
*
* The bundle type.
**/
typedef enum {
AS_BUNDLE_KIND_UNKNOWN,
AS_BUNDLE_KIND_LIMBA,
AS_BUNDLE_KIND_XDG_APP,
/*< private >*/
AS_BUNDLE_KIND_LAST
} AsBundleKind;
AsBundle *as_bundle_new (void);
/* helpers */
AsBundleKind as_bundle_kind_from_string (const gchar *kind);
const gchar *as_bundle_kind_to_string (AsBundleKind kind);
/* getters */
const gchar *as_bundle_get_id (AsBundle *bundle);
const gchar *as_bundle_get_runtime (AsBundle *bundle);
const gchar *as_bundle_get_sdk (AsBundle *bundle);
AsBundleKind as_bundle_get_kind (AsBundle *bundle);
/* setters */
void as_bundle_set_id (AsBundle *bundle,
const gchar *id);
void as_bundle_set_runtime (AsBundle *bundle,
const gchar *runtime);
void as_bundle_set_sdk (AsBundle *bundle,
const gchar *sdk);
void as_bundle_set_kind (AsBundle *bundle,
AsBundleKind kind);
G_END_DECLS
#endif /* __AS_BUNDLE_H */
|
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2009-2018 Brazil
Copyright(C) 2020 Sutou Kouhei <kou@clear-code.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.
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
*/
#pragma once
#include <groonga.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
GRN_PROC_INVALID = 0,
GRN_PROC_TOKENIZER,
GRN_PROC_COMMAND,
GRN_PROC_FUNCTION,
GRN_PROC_HOOK,
GRN_PROC_NORMALIZER,
GRN_PROC_TOKEN_FILTER,
GRN_PROC_SCORER,
GRN_PROC_WINDOW_FUNCTION,
GRN_PROC_AGGREGATOR,
} grn_proc_type;
GRN_API grn_obj *grn_proc_create(grn_ctx *ctx,
const char *name, int name_size, grn_proc_type type,
grn_proc_func *init, grn_proc_func *next, grn_proc_func *fin,
unsigned int nvars, grn_expr_var *vars);
GRN_API grn_obj *grn_proc_get_info(grn_ctx *ctx, grn_user_data *user_data,
grn_expr_var **vars, unsigned int *nvars, grn_obj **caller);
GRN_API grn_proc_type grn_proc_get_type(grn_ctx *ctx, grn_obj *proc);
typedef grn_rc (*grn_proc_option_value_parse_func)(grn_ctx *ctx,
const char *name,
grn_obj *value,
const char *tag,
void *user_data);
typedef enum {
GRN_PROC_OPTION_VALUE_RAW,
GRN_PROC_OPTION_VALUE_MODE,
GRN_PROC_OPTION_VALUE_OPERATOR,
GRN_PROC_OPTION_VALUE_EXPR_FLAGS,
GRN_PROC_OPTION_VALUE_INT64,
GRN_PROC_OPTION_VALUE_BOOL,
GRN_PROC_OPTION_VALUE_FUNC,
GRN_PROC_OPTION_VALUE_TOKENIZE_MODE,
GRN_PROC_OPTION_VALUE_TOKEN_CURSOR_FLAGS,
} grn_proc_option_value_type;
GRN_API grn_rc
grn_proc_options_parse(grn_ctx *ctx,
grn_obj *options,
const char *tag,
const char *name,
...);
GRN_API grn_rc
grn_proc_options_parsev(grn_ctx *ctx,
grn_obj *options,
const char *tag,
const char *name,
va_list args);
#ifdef __cplusplus
}
#endif
|
/*
* 1394-Based Digital Camera Control Library
*
* Written by Damien Douxchamps <ddouxchamps@users.sf.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
*/
#include <dc1394/log.h>
#include <dc1394/video.h>
#ifndef __DC1394_CAPTURE_H__
#define __DC1394_CAPTURE_H__
/*! \file dc1394/capture.h
\brief Capture functions
\author Damien Douxchamps: coding
\author Peter Antoniac: documentation maintainer
More details soon
*/
/**
* The capture policy.
*
* Can be blocking (wait for a frame forever) or polling (returns if no frames is in the ring buffer)
*/
typedef enum {
DC1394_CAPTURE_POLICY_WAIT=672,
DC1394_CAPTURE_POLICY_POLL
} dc1394capture_policy_t;
#define DC1394_CAPTURE_POLICY_MIN DC1394_CAPTURE_POLICY_WAIT
#define DC1394_CAPTURE_POLICY_MAX DC1394_CAPTURE_POLICY_POLL
#define DC1394_CAPTURE_POLICY_NUM (DC1394_CAPTURE_POLICY_MAX - DC1394_CAPTURE_POLICY_MIN + 1)
/**
* Capture flags. Currently limited to switching automatic functions on/off: channel allocation, bandwidth allocation and automatic
* starting of ISO transmission
*/
#define DC1394_CAPTURE_FLAGS_CHANNEL_ALLOC 0x00000001U
#define DC1394_CAPTURE_FLAGS_BANDWIDTH_ALLOC 0x00000002U
#define DC1394_CAPTURE_FLAGS_DEFAULT 0x00000004U /* a reasonable default value: do bandwidth and channel allocation */
#define DC1394_CAPTURE_FLAGS_AUTO_ISO 0x00000008U /* automatically start iso before capture and stop it after */
#ifdef __cplusplus
extern "C" {
#endif
/***************************************************************************
Capture Functions
***************************************************************************/
/**
* Setup the capture, using a ring buffer of a certain size (num_dma_buffers) and certain options (flags)
*/
dc1394error_t dc1394_capture_setup(dc1394camera_t *camera, uint32_t num_dma_buffers, uint32_t flags);
/**
* Stop the capture
*/
dc1394error_t dc1394_capture_stop(dc1394camera_t *camera);
/**
* Gets a file descriptor to be used for select(). Must be called after dc1394_capture_setup().
*/
int dc1394_capture_get_fileno (dc1394camera_t * camera);
/**
* Captures a video frame. The returned struct contains the image buffer, among others. This image buffer SHALL NOT be freed, as it represents an area
* in the memory that belongs to the system.
*/
dc1394error_t dc1394_capture_dequeue(dc1394camera_t * camera, dc1394capture_policy_t policy, dc1394video_frame_t **frame);
/**
* Returns a frame to the ring buffer once it has been used.
*/
dc1394error_t dc1394_capture_enqueue(dc1394camera_t * camera, dc1394video_frame_t * frame);
/**
* Returns DC1394_TRUE if the given frame (previously dequeued) has been
* detected to be corrupt (missing data, corrupted data, overrun buffer, etc.).
* Note that certain types of corruption may go undetected in which case
* DC1394_FALSE will be returned. The ability to detect corruption also
* varies between platforms. Note that corrupt frames still need to be
* enqueued with dc1394_capture_enqueue() when no longer needed by the user.
*/
dc1394bool_t dc1394_capture_is_frame_corrupt (dc1394camera_t * camera,
dc1394video_frame_t * frame);
#ifdef __cplusplus
}
#endif
#endif
|
/***********************************************************************
*
* This file is part of Anthaxia.
*
* Anthaxia 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.
*
* Anthaxia 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 Anthaxia. If not, see <http://www.gnu.org/licenses/>.
*
***********************************************************************/
#ifndef _MIPSMODEL_H
#define _MIPSMODEL_H
#include "Simulator.h"
#include "plugins/Plugin.h"
#include "plugins/processor/ProcessorControl.h"
#include <string>
#include <vector>
#ifdef _MSC_VER
#include "platform/windows/stdint.h"
#else
#include <stdint.h>
#endif
class MemoryObserver;
class SimulatorThread;
class SimulationObserver;
class MipsModel : public ProcessorControl, public ProcessorModel
{
public:
MipsModel();
virtual ~MipsModel();
std::string getPluginName();
///////////////////////////////////////
// Simulation control interface
///////////////////////////////////////
/**
* Start the simulation in a separate thread
*/
void run();
/**
* Execute one instruction of this processor model. When the simulation was
* previously running it will be stopped.
*/
void step();
/**
* Stop the currently running simulation
*/
void stop();
/**
* Reset the processor
*/
void reset();
////////////////////////////////////////////
// Simulation information interface
////////////////////////////////////////////
/**
* Returns the current value of the program counter.
*/
int getPC() const;
/**
* Get the content of the processor register with the given index. When the
* given index is available on this processor true is returned and the
* value is passed back by reference.
*/
bool getRegister(int index, int& value) const;
/**
* Set the content of the processor register with the given index. When the
* given index is available on this processor true is returned and the
* value is set.
*/
bool setRegister(int index, int value);
/**
* Returns the name for the register with the given index via the name
* reference variable if the return value is true. When false is returned,
* the given index is not a valid register.
*/
bool getRegisterName(int index, std::string& name) const;
/**
* Returns the number of valid registers for this processor. Registers with
* an index in the range 0<=index<getRegisterCount() are valid processor
* registers.
*/
int getRegisterCount() const;
/**
* Indicates whether the register with the given index has been changed
* since the stop of the simulation.
*/
bool isRegisterDirty(int index) const;
///////////////////////////////////
// Processor memory interface
///////////////////////////////////
bool getSmallMemoryByte(int address, unsigned char& value) const;
bool setSmallMemoryByte(int address, unsigned char value);
bool getSmallMemoryHalfWord(int address, unsigned short& value) const;
bool setSmallMemoryHalfWord(int address, unsigned short value);
bool getSmallMemoryWord(int address, unsigned int& value) const;
bool setSmallMemoryWord(int address, unsigned int value);
// Multi bus memory interface
void getMemoryList(std::vector<std::string>& list);
MemoryByteInterface* getByteInterfaceByName(std::string& memory_name);
MemoryWordInterface* getWordInterfaceByName(std::string& memory_name);
MemoryByteInterface* getByteInterfaceByIndex(int index);
MemoryWordInterface* getWordInterfaceByIndex(int index);
///////////////////////////////
// Disassembler interface
///////////////////////////////
std::string disassembleInstruction(int address) const;
///////////////////////////////////////
// Generic processor model interface
///////////////////////////////////////
virtual void executeInstruction();
//////////////////////////////
// Notification interface
//////////////////////////////
void registerMemoryObserver(MemoryObserver* observer);
void transactionComplete();
private:
enum {
IST_J = 2,
IST_JAL = 3,
IST_BEQ = 4,
IST_BNE = 5,
IST_BLE = 6,
IST_BGT = 7,
IST_ADDI = 8,
IST_ADDIU = 9,
IST_SLTI = 10,
IST_SLTIU = 11,
IST_ANDI = 12,
IST_ORI = 13,
IST_XORI = 14,
IST_LUI = 15,
IST_MxC0 = 16,
IST_LB = 32,
IST_LH = 33,
IST_LW = 35,
IST_LBU = 37,
IST_SB = 40,
IST_SH = 41,
IST_SW = 43
};
enum {
HI = 32,
LO = 33
};
private:
void notifyMemoryChanged();
std::vector<MemoryObserver*> mMemoryObservers;
void _reset();
int mPC, mPCnext, mEPC;
int mExceptionId;
bool mSkip;
uint32_t mStatus;
int mRegister[34];
bool mRegisterDirtyFlag[34];
uint32_t mCounter;
uint32_t mIrqMask;
uint32_t mIrqStatus;
unsigned char mMemory[65536];
SimulatorThread* mSimThread;
friend class MipsMemoryProxy;
};
class PluginManager;
PLUGIN_API void registerPlugin(PluginManager* pm);
#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 QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SQSERROR_P_H
#define SQSERROR_P_H
#include "sqserror.h"
namespace QtAws {
namespace SqsOld {
class SqsErrorPrivate {
public:
SqsError::ErrorCode code; ///< SQS error code.
QVariantMap detail; ///< SQS error detail.
QString message; ///< SQS error message.
QString rawCode; ///< Raw SQS error code.
QString rawType; ///< Raw SQS error type.
SqsError::ErrorType type; ///< SQS error type.
SqsErrorPrivate(SqsError * const q);
SqsErrorPrivate(const SqsErrorPrivate * const other, SqsError * const q);
virtual ~SqsErrorPrivate();
void parse(QXmlStreamReader &xml);
static SqsError::ErrorCode codeFromString(const QString &code);
static SqsError::ErrorType typeFromString(const QString &type);
private:
Q_DECLARE_PUBLIC(SqsError)
Q_DISABLE_COPY(SqsErrorPrivate)
SqsError * const q_ptr; ///< Internal q-pointer.
};
} // namespace SqsOld
} // namespace QtAws
#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_DELETEPARTITIONINDEXREQUEST_P_H
#define QTAWS_DELETEPARTITIONINDEXREQUEST_P_H
#include "gluerequest_p.h"
#include "deletepartitionindexrequest.h"
namespace QtAws {
namespace Glue {
class DeletePartitionIndexRequest;
class DeletePartitionIndexRequestPrivate : public GlueRequestPrivate {
public:
DeletePartitionIndexRequestPrivate(const GlueRequest::Action action,
DeletePartitionIndexRequest * const q);
DeletePartitionIndexRequestPrivate(const DeletePartitionIndexRequestPrivate &other,
DeletePartitionIndexRequest * const q);
private:
Q_DECLARE_PUBLIC(DeletePartitionIndexRequest)
};
} // namespace Glue
} // namespace QtAws
#endif
|
// Created file "Lib\src\ehstorguids\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(PKEY_Contact_CallbackTelephone, 0xbf53d1c3, 0x49e0, 0x4f7f, 0x85, 0x67, 0x5a, 0x82, 0x1d, 0x8a, 0xc5, 0x42);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.