blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 333 | content_id stringlengths 40 40 | detected_licenses listlengths 0 58 | license_type stringclasses 2 values | repo_name stringlengths 5 113 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 604 values | visit_date timestamp[us]date 2016-08-02 21:20:34 2023-09-06 10:17:08 | revision_date timestamp[us]date 1970-01-01 00:00:00 2023-09-05 20:12:54 | committer_date timestamp[us]date 1970-01-01 00:00:00 2023-09-05 20:12:54 | github_id int64 966 664M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23 values | gha_event_created_at timestamp[us]date 2012-06-18 16:43:44 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-02-03 21:17:16 2023-07-07 15:57:14 ⌀ | gha_language stringclasses 121 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 128 17.8k | extension stringclasses 134 values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 143 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ce0ca57897e49ff7613512aa0d9b77f9e8db5087 | 27bcd5c9ded70102540c0ccd03f3e2b281dbf58c | /mudlib/w/barthleby/noella/rooms/bosque_noella/bosque_noella14.c | 0d13b0dfda2abf9105f1e75d25faea9cb794f1f7 | [] | no_license | unleashed/ninetears | 57fdc71fd651b3ff95e5e7c14b0566729584e006 | 4edd22c75e3fa99be4b5820300491c6b62e06085 | refs/heads/master | 2020-07-14T04:25:56.302027 | 2019-08-29T18:46:57 | 2019-08-29T18:46:57 | 205,225,438 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 327 | c | #include "/w/barthleby/path.h"
inherit BOSQUE"std_bosque_noella.c";
void setup()
{
base_desc();
set_exit_color("cyan");
set_short("%^GREEN%^Camino en el bosque%^RESET%^");
long_desc_bosque_noella();
add_exit("noroeste", BOSQUE+"bosque_noella13","road");
add_exit("este", BOSQUE+"bosque_noella15","road");
}
| [
"amr@redhat.com"
] | amr@redhat.com |
d70d9695eb1fdb81443d2bb12b935b315eaa9c57 | 5552b480dd01502469f31ba81db9ea0d37671cf2 | /intern_word.h | acf4d55922ad80ff94ff80466a773c25f52b2dee | [
"Apache-2.0"
] | permissive | tdunning/ancient-stats | b10cf0e665d7a0648dd8503127dd103103185096 | 4d49826e0b6b1a718a71e74e35fac48436c81c20 | refs/heads/master | 2023-09-04T01:56:28.462601 | 2015-06-19T18:59:37 | 2015-06-19T18:59:37 | 18,982,799 | 5 | 2 | null | null | null | null | UTF-8 | C | false | false | 894 | h | /*
Copyright (c) 1996, Aptex Inc. 9605 Scranton Road Suite 240, San Diego.
All Rights Reserved.
THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF APTEX INC
The copyright notice above does not evidence any actual or intended
publication of such source code.
RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the government
is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the
Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
and FAR 52.227-19.
Product:
Stats - text statistical analysis software
Module:
intern_word.c
Created:
5/1/96
Authors Initials Involvement
------- -------- -----------
Ted Dunning ted Creator
*/
#include "hash.h"
hash_bucket intern_word(hash_table word_table, char *w);
char *get_interned_string(hash_bucket p);
| [
"tdunning@apache.org"
] | tdunning@apache.org |
e8d551e4883d8bd83946080d5fe46964271cae6f | c425afb8bb6b182168fd4c3a46c9b334f4740e60 | /data/template/unknow/luck_ring-1632024509.c | 76e3060ba50c2a9e411274ec8805f171d0db1c88 | [] | no_license | fluffos/nt7 | ceef82b2465cf322549c7ece6ce757eaa8ec31ff | 52727f5a4266b14f1796c2aa297ca645ca07282a | refs/heads/main | 2023-06-17T10:07:33.000534 | 2021-07-15T11:15:05 | 2021-07-15T11:15:05 | 308,148,401 | 9 | 9 | null | 2021-06-28T14:11:57 | 2020-10-28T21:45:40 | C | UTF-8 | C | false | false | 1,194 | c | // luck_ring.c
// Create by TEMPLATE_D. Sun Jan 20 20:54:09 2019.
// This program is a part of NT MudLIB
#include <ansi.h>
#include <armor.h>
inherit RINGS;
void create()
{
set_name("[45m幸运女神戒指[2;37;0m", ({ "luck ring" }));
set_weight(500);
/*if (clonep())
set_default_object(__FILE__);
else*/
{
set("unit", "个");
set("long", "[1;33m这便是幸运女神戴过的戒指,神光浮现。
[2;37;0m");
set("value", 3000);
set("no_sell", 1);
set("rigidity", 8000);
set("material", "tian jing");
set("no_pawn", 1);
set("armor_prop", ([ /* sizeof() == 1 */
"armor" : 10,
]));
}
set("mod_mark", "A3022");
set("mod_level", "M3002");
set("mod_name", "[41;1m幸运女神之眷念[2;37;0m");
set("quality_level", 4);
set("armor_type", "rings");
set("no_store", 1);
set("item_owner", "alxpang");
set("stable", 50);
set("consistence", 100);
setup();
}
int receive_summon(object me)
{
return ITEM_D->receive_summon(me, this_object());
}
// 隐藏物品
int hide_anywhere(object me)
{
return ITEM_D->hide_anywhere(me, this_object());
}
int is_no_clone() { return 1; }
| [
"i@oiuv.cn"
] | i@oiuv.cn |
3c7b46ee864d1cd2ebe79cc709e47b078c383f81 | 0c5d3b088080577388f5766431487534f93a2c40 | /Github-Projects-Origin/linux-master/drivers/pci/host-bridge.c.bak.c | 52f3b3eb7ceec521a939acb0972028c6a035a02f | [] | no_license | zhiyuanjia/WoBench | 878255ce45e76ef57f88743c7f43acdfa59e93e7 | 6b337780cbd598de98fc0eabd19efaf1a01b6012 | refs/heads/master | 2021-09-23T03:12:08.091319 | 2018-06-14T10:17:59 | 2018-06-14T10:17:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,481 | c | #include <assert.h>
#include <string.h>
#define INCLUDEMAIN
// SPDX-License-Identifier: GPL-2.0
/*
* host bridge related code
*/
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/module.h>
#include "pci.h"
static struct pci_bus *find_pci_root_bus(struct pci_bus *bus)
{
while (bus->parent)
bus = bus->parent;
return bus;
}
struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus)
{
struct pci_bus *root_bus = find_pci_root_bus(bus);
return to_pci_host_bridge(root_bus->bridge);
}
struct device *pci_get_host_bridge_device(struct pci_dev *dev)
{
struct pci_bus *root_bus = find_pci_root_bus(dev->bus);
struct device *bridge = root_bus->bridge;
kobject_get(&bridge->kobj);
return bridge;
}
void pci_put_host_bridge_device(struct device *dev)
{
kobject_put(&dev->kobj);
}
void pci_set_host_bridge_release(struct pci_host_bridge *bridge,
void (*release_fn)(struct pci_host_bridge *),
void *release_data)
{
bridge->release_fn = release_fn;
bridge->release_data = release_data;
}
EXPORT_SYMBOL_GPL(pci_set_host_bridge_release);
void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region,
struct resource *res)
{
struct pci_host_bridge *bridge = pci_find_host_bridge(bus);
struct resource_entry *window;
resource_size_t offset = 0;
resource_list_for_each_entry(window, &bridge->windows) {
if (resource_contains(window->res, res)) {
offset = window->offset;
break;
}
}
region->start = res->start - offset;
region->end = res->end - offset;
}
EXPORT_SYMBOL(pcibios_resource_to_bus);
static bool region_contains(struct pci_bus_region *region1,
struct pci_bus_region *region2)
{
return region1->start <= region2->start && region1->end >= region2->end;
}
void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,
struct pci_bus_region *region)
{
struct pci_host_bridge *bridge = pci_find_host_bridge(bus);
struct resource_entry *window;
resource_size_t offset = 0;
resource_list_for_each_entry(window, &bridge->windows) {
struct pci_bus_region bus_region;
if (resource_type(res) != resource_type(window->res))
continue;
bus_region.start = window->res->start - window->offset;
bus_region.end = window->res->end - window->offset;
if (region_contains(&bus_region, region)) {
offset = window->offset;
break;
}
}
res->start = region->start + offset;
res->end = region->end + offset;
}
EXPORT_SYMBOL(pcibios_bus_to_resource);
| [
"wangcong15@mails.tsinghua.edu.cn"
] | wangcong15@mails.tsinghua.edu.cn |
a2e521aba8cb510ddb771baefb08e7614f0c44bf | 5c255f911786e984286b1f7a4e6091a68419d049 | /vulnerable_code/181912bb-8fcf-43c9-9604-33cfa2f29619.c | 09cd446caefd080bddeb7ffd0097618d4f340295 | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 572 | c | #include <string.h>
#include <stdio.h>
int main() {
int i=0;
int j=12;
int k;
int l;
k = 53;
l = 64;
k = i/j;
l = i/j;
l = l/j;
l = i/j;
l = i/j;
l = l%j;
k = l-j*i;
//variables
/* START VULNERABILITY */
int a;
long b[82];
long c[68];
a = 0;
do {
//random
/* START BUFFER SET */
*((long *)c + a) = *((long *)b + a);
/* END BUFFER SET */
a++;
} while(a < strlen(b));
/* END VULNERABILITY */
printf("%d%d\n",k,l);
return 0;
}
| [
"nharmon8@gmail.com"
] | nharmon8@gmail.com |
bca4ba2599270154acdfd78e90069036f90edb9d | 5896167027f07d1e53672ebb76b60ed7bf2f09c8 | /Win10_20H1_18990/x64/System32/ntoskrnl.exe/Standalone/_MI_PAGING_IO_STATE.h | 986aa02e1c4262552775735c29549246b19cfb35 | [] | no_license | antiwar3/headers | c776e1de8b552e1284901361907f5e7515ef20ae | e3ec0f11f62cdc76b6c0b6b9fa0d6ffe55e476f0 | refs/heads/master | 2021-05-25T22:49:20.063532 | 2020-02-24T21:43:26 | 2020-02-24T21:44:11 | 253,953,543 | 1 | 2 | null | 2020-04-08T01:25:44 | 2020-04-08T01:25:44 | null | UTF-8 | C | false | false | 1,803 | h | typedef struct _RTL_AVL_TREE
{
/* 0x0000 */ struct _RTL_BALANCED_NODE* Root;
} RTL_AVL_TREE, *PRTL_AVL_TREE; /* size: 0x0008 */
typedef union _SLIST_HEADER
{
union
{
struct
{
/* 0x0000 */ unsigned __int64 Alignment;
/* 0x0008 */ unsigned __int64 Region;
}; /* size: 0x0010 */
struct
{
struct /* bitfield */
{
/* 0x0000 */ unsigned __int64 Depth : 16; /* bit position: 0 */
/* 0x0000 */ unsigned __int64 Sequence : 48; /* bit position: 16 */
}; /* bitfield */
struct /* bitfield */
{
/* 0x0008 */ unsigned __int64 Reserved : 4; /* bit position: 0 */
/* 0x0008 */ unsigned __int64 NextEntry : 60; /* bit position: 4 */
}; /* bitfield */
} /* size: 0x0010 */ HeaderX64;
}; /* size: 0x0010 */
} SLIST_HEADER, *PSLIST_HEADER; /* size: 0x0010 */
typedef struct _MI_PAGING_IO_STATE
{
/* 0x0000 */ struct _RTL_AVL_TREE PageFileHead;
/* 0x0008 */ volatile long PageFileHeadSpinLock;
/* 0x000c */ long PrefetchSeekThreshold;
/* 0x0010 */ unsigned long InPageSinglePages;
/* 0x0020 */ union _SLIST_HEADER InPageSupportSListHead[2];
/* 0x0040 */ union _SLIST_HEADER ReservedInPageSupportSListHead[2];
/* 0x0060 */ unsigned char InPageSupportSListMinimum[2];
/* 0x0068 */ struct _MMINPAGE_SUPPORT* FirstReservedInPageBlock[2];
/* 0x0078 */ struct _MMINPAGE_SUPPORT* LastReservedInPageBlock[2];
/* 0x0088 */ struct _MMPTE* ReservedPtes;
/* 0x0090 */ unsigned __int64 ReservedPtesLock;
/* 0x0098 */ unsigned long ReservedPtesBitBuffer;
/* 0x009c */ volatile long DelayPageFaults;
/* 0x00a0 */ unsigned long FileCompressionBoundary;
/* 0x00a4 */ unsigned char MdlsAdjusted;
/* 0x00a5 */ char __PADDING__[11];
} MI_PAGING_IO_STATE, *PMI_PAGING_IO_STATE; /* size: 0x00b0 */
| [
"w.benny@outlook.com"
] | w.benny@outlook.com |
894a7215572761c78d7caff882f22bdbc4dcbea5 | 56285ed1eab50652b85df97aa46b494c00ffb1b4 | /Control/Copy_of_Control_Caldera/codegen/mex/predictRF_Y1/interface/_coder_predictRF_Y1_info.h | 68da2df8ce2cc780f4efd45d7d486ff3d728add2 | [] | no_license | pdiaz2/Espesador_Matlab | a9b889a7532bd58fba15ded2ab18ebd9148965c7 | dee64b5a9b5c4dcac1b14a8603ac6e45da6c5a76 | refs/heads/master | 2021-07-12T22:34:40.214281 | 2018-12-01T19:53:15 | 2018-12-01T19:53:15 | 130,898,524 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 652 | h | /*
* _coder_predictRF_Y1_info.h
*
* Code generation for function '_coder_predictRF_Y1_info'
*
*/
#ifndef _CODER_PREDICTRF_Y1_INFO_H
#define _CODER_PREDICTRF_Y1_INFO_H
/* Include files */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mwmathutil.h"
#include "tmwtypes.h"
#include "mex.h"
#include "emlrt.h"
#include "rtwtypes.h"
#include "predictRF_Y1_types.h"
/* Function Declarations */
MEXFUNCTION_LINKAGE mxArray *emlrtMexFcnProperties(void);
extern const mxArray *emlrtMexFcnResolvedFunctionsInfo(void);
#endif
/* End of code generation (_coder_predictRF_Y1_info.h) */
| [
"pdiaz2@uc.cl"
] | pdiaz2@uc.cl |
d22a89c73fa5ad1612cdf56b06534ad1ab8c0dd1 | 793342a650fe8cd0421b3cff99bcf998669e6ec2 | /pagerank-straw.h | b649879f5e7cbf7297afa46a9f5ba6642997aadb | [] | no_license | cavazos-lab/CISC372-Project | cbcd2d1e67d7aff28e3d2fee7ca063c07eea659e | c025bb53d227032aa9bdf66a01eaf75e6ce501b8 | refs/heads/master | 2021-01-21T12:06:31.483102 | 2016-04-23T19:32:47 | 2016-04-23T19:32:47 | 34,557,340 | 0 | 2 | null | null | null | null | UTF-8 | C | false | false | 3,461 | h | #ifndef PAGERANK_STRAW_H__
#define PAGERANK_STRAW_H__
//// stochastic matrix and page rank functions, initial "strawman" versions ////
void scale(double *C, SparseMatrix S) ;
// Convert S from link matrix to stochastic matrix.
// Also set C to the column sums of the original link matrix.
void strawman_mvpSM(double * y, SparseMatrix S, double *x) ;
// Matrix-vector product, Sparse Matrix:
// For length S->rowdim vector y, length S->coldim vector x, compute y = S*x.
// random surfer clicks a link
void click(SparseMatrix S, double *C, double d, double *y0, double *y1,
void (* spmv)(double *z, SparseMatrix S, double *y0)) ;
// compute y1 = (1-d)*u + d*S*y0.
// d is the damping parameter
// y0 is the initial probability distribution vector.
// spmv is a sparse matrix times vector function that computes z = S*y0.
// y1 is the resulting probability distribution vector.
int solve(SparseMatrix S, double *C, double d, double *y0, double *y, double epsilon,
void (* spmv)(double * w, SparseMatrix S, double * z)) ;
// Repeat click until two successive y's are closer than epsilon.
// d is the damping parameter
// y0 is the initial probability distribution vector.
// Upon return y is the final vector, the page rank vector.
// epsilon is the convergence requirement
// spmv is a sparse matrix times vector function that computes w = S*z.
// The return value is the number of iterations that were used.
/////// implementations ///////////////
void strawman_mvpSM(double * y, SparseMatrix S, double *x) {
// Matrix-vector product, Sparse Matrix:
// For length S->rowdim vector y, length S->coldim vector x, compute y = S*x.
int i, k;
for (i = 0; i < S->rowdim; ++i) y[i] = 0;
for (k = 0; k < S->nnz; ++k)
y[S->row[k]] += S->val[k] * x[S->col[k]];
}
void scale(double *C, SparseMatrix S) {
// Convert S from link matrix to stochastic matrix.
// Also set C to the column sums of the original link matrix.
int i, k;
for (i = 0; i < S->coldim; ++i) C[i] = 0;
for (k = 0; k < S->nnz; ++k) C[S->col[k]] += 1;
for (k = 0; k < S->nnz; ++k) S->val[k] = 1/C[S->col[k]];
// the zero cols?
}
void click(SparseMatrix S, double *C, double d, double *y0, double *y1,
void (* spmv)(double *, SparseMatrix, double *)) {
// compute y1 = (1-d)u + d S y0.
int i;
spmv(y1, S, y0);
// true S is given S + 1/n's in cols where given S is entirely zero.
// get the contribution of the zero columns
double xs = 0;
for (i = 0; i < S->coldim; ++i) if (C[i] == 0) xs += y0[i];
xs = xs/S->coldim;
// get contribution of xs and of (1-d)u.
xs = d*xs;
double omdbyn = (1-d)/S->coldim; // entry of (1-d)u.
for (i = 0; i < S->coldim; ++i) y1[i] = d*y1[i] + omdbyn + xs;
}
int solve(SparseMatrix S, double *C, double d, double *y0, double *y, double epsilon,
void (* spmv)(double *, SparseMatrix, double *)) {
// repeat click until two successive y's are closer than epsilon.
// y0 is the initial probability distribution vector.
// Upon return y is the final vector, the page rank vector.
// The return value is the number of iterations that were used.
int i, iters = 0;
double epssq = epsilon*epsilon;
double disq;
double *x = (double *) malloc(S->coldim*sizeof(double));
for (i = 0; i < S->coldim; ++i) x[i] = y0[i];
do {
click(S, C, d, x, y, spmv);
++iters;
disq = vecdistsq(y, x, S->coldim);
for (i = 0; i < S->coldim; ++i) x[i] = y[i]; // prep for next iter.
} while (disq > epssq);
return iters;
}
#endif // PAGERANK_STRAW_H__
| [
"weiwang.udel@gmail.com"
] | weiwang.udel@gmail.com |
c2c4c84e29e5609c4ff6510f76258a64cd0b1cd7 | 0d3187362424d29dadb8adfed2c9a6b880fb3ed6 | /src/colors.h | 5f70225651d5e5c67049388c7dc6112d0e7b0e3e | [] | no_license | happymobilecq/paint | 2043d9b7a18028f217a264a3fa4f0ed4cce178e5 | f715a49fb2b22472721e105e666bead1bd088b69 | refs/heads/main | 2023-02-05T10:58:49.980227 | 2020-12-29T11:09:35 | 2020-12-29T11:09:35 | 325,262,479 | 1 | 2 | null | null | null | null | UTF-8 | C | false | false | 3,584 | h | /*
colors.h
For Tux Paint
List of colors
Copyright (c) 2002-2007 by Bill Kendrick and others
bill@newbreedsoftware.com
http://www.tuxpaint.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
June 14, 2002 - July 17, 2007
$Id: colors.h,v 1.22 2007/07/17 18:41:22 wkendrick Exp $
*/
#ifndef COLORS_H
#define COLORS_H
/* What colors are available: */
enum
{
COLOR_BLACK,
COLOR_DARKGREY,
COLOR_LIGHTGREY,
COLOR_WHITE,
COLOR_RED,
COLOR_ORANGE,
COLOR_YELLOW,
COLOR_LIGHTGREEN,
COLOR_DARKGREEN,
COLOR_SKYBLUE,
COLOR_BLUE,
COLOR_LAVENDER,
COLOR_PURPLE,
COLOR_PINK,
COLOR_BROWN,
COLOR_TAN,
COLOR_BEIGE,
NUM_DEFAULT_COLORS
};
/* Hex codes: */
const int default_color_hexes[NUM_DEFAULT_COLORS][3] = {
{0, 0, 0}, /* Black */
{128, 128, 128}, /* Dark grey */
{192, 192, 192}, /* Light grey */
{255, 255, 255}, /* White */
{255, 0, 0}, /* Red */
{255, 128, 0}, /* Orange */
{255, 255, 0}, /* Yellow */
{160, 228, 128}, /* Light green */
{33, 148, 70}, /* Dark green */
{138, 168, 205}, /* Sky blue */
{50, 100, 255}, /* Blue */
{186, 157, 255}, /* Lavender */
{128, 0, 128}, /* Purple */
{255, 165, 211}, /* Pink */
{128, 80, 0}, /* Brown */
{226, 189, 166}, /* Tan */
{247, 228, 219} /* Beige */
};
/* Color names: */
const char *const default_color_names[NUM_DEFAULT_COLORS] = {
// Response to Black (0, 0, 0) color selected
gettext_noop("Black!"),
// Response to Dark grey (128, 128, 128) color selected
gettext_noop("Dark grey! Some people spell it “dark gray”."),
// Response to Light grey (192, 192, 192) color selected
gettext_noop("Light grey! Some people spell it “light gray”."),
// Response to White (255, 255, 255) color selected
gettext_noop("White!"),
// Response to Red (255, 0, 0) color selected
gettext_noop("Red!"),
// Response to Orange (255, 128, 0) color selected
gettext_noop("Orange!"),
// Response to Yellow (255, 255, 0) color selected
gettext_noop("Yellow!"),
// Response to Light green (160, 228, 128) color selected
gettext_noop("Light green!"),
// Response to Dark green (33, 148, 70) color selected
gettext_noop("Dark green!"),
// Response to "Sky" blue (138, 168, 205) color selected
gettext_noop("Sky blue!"),
// Response to Blue (50, 100, 255) color selected
gettext_noop("Blue!"),
// Response to Lavender (186, 157, 255) color selected
gettext_noop("Lavender!"),
// Response to Purple (128, 0, 128) color selected
gettext_noop("Purple!"),
// Response to Pink (255, 165, 211) color selected
gettext_noop("Pink!"),
// Response to Brown (128, 80, 0) color selected
gettext_noop("Brown!"),
// Response to Tan (226, 189, 166) color selected
gettext_noop("Tan!"),
// Response to Beige (247, 228, 219) color selected
gettext_noop("Beige!")
};
char colorfile[256];
#endif /* COLORS_H */
| [
"you@example.com"
] | you@example.com |
e8de982db4ab4f8930c54608a1444b0d1f6ca969 | f363fdb9445d8dec088fb02c8faae8e23570a33e | /d/quanzhen/npc/zhangli.c | e8defa16972dfd0429461e3570d8c285698b61ce | [] | no_license | MudRen/zjmud | 0999a492ac0717911c047936ee2c696b3b5cb20a | c56a166380d74858d7b4f0ba2817478ccea6b83d | refs/heads/main | 2023-07-24T21:02:00.246591 | 2021-09-07T12:50:20 | 2021-09-07T12:50:20 | 403,973,627 | 1 | 1 | null | null | null | null | GB18030 | C | false | false | 2,072 | c | // zhangli.c 掌理道长
// By Lgg,1998.10
inherit NPC;
string ask_me();
void create()
{
set_name("掌理道长", ({"zhangli"}));
set("gender", "男性");
set("age", 22);
set("class", "taoist");
set("long",
"这是一位年纪很轻的道人,他精明能干,是全真教第四代弟子\n"
"中出类拔瘁的人物,前辈真人们分派他来掌理全教上下的杂务。\n");
set("attitude", "friendly");
set("shen_type",1);
set("str", 22);
set("int", 22);
set("con", 22);
set("dex", 22);
set("qi", 600);
set("max_qi", 600);
set("jing", 400);
set("max_jing", 400);
set("neili", 1200);
set("max_neili", 1200);
set("jiali", 0);
set("combat_exp", 30000);
set("score", 20000);
set_skill("force", 60);
set_skill("quanzhen-xinfa", 50);
set_skill("sword", 60);
set_skill("quanzhen-jian",60);
set_skill("dodge", 50);
set_skill("jinyan-gong", 50);
set_skill("parry", 60);
set_skill("unarmed",60);
set_skill("strike",60);
set_skill("haotian-zhang", 50);
set_skill("literate",50);
set_skill("taoism",40);
map_skill("force", "quanzhen-xinfa");
map_skill("sword", "quanzhen-jian");
map_skill("dodge", "jinyan-gong");
map_skill("parry", "quanzhen-jian");
map_skill("strike", "haotian-zhang");
prepare_skill("strike", "haotian-zhang");
create_family("全真教", 4, "弟子");
set("book_count",1);
set("inquiry", ([
"全真教" : "我全真教是天下道家玄门正宗。\n",
"道德经" : (: ask_me :),
]) );
setup();
carry_object("/clone/weapon/changjian")->wield();
carry_object(__DIR__"obj/grayrobe")->wear();
}
string ask_me()
{
mapping fam;
object ob;
if (!(fam = this_player()->query("family")) || fam["family_name"] != "全真教")
return RANK_D->query_respect(this_player()) +
"与本教毫无瓜葛,你这话可叫我弄不明白了。";
if (query("book_count") < 1)
return "你来晚了,道德经已经被人取走了。";
add("book_count", -1);
ob = new(__DIR__"obj/daodejing-ii");
ob->move(this_player());
return "好吧,这本「道德经」你拿回去好好研读。";
}
| [
"i@oiuv.cn"
] | i@oiuv.cn |
b622988a7e8828ff240ca7aa3726582eae8bc342 | eaae3529ea65c9be62e4b177a498dd0459396052 | /modified_vars_lib/dave.t_Close_Match.c | 71e34cb80b6b6b6a101a2d5fbbedef708d7c06db | [] | no_license | mgsanusi/blame-dodger | badac55079b0bc84c1c3ddff9357caffd480b512 | c8b1f19d48e09200c9d59f3dda3b298ced7103d7 | refs/heads/master | 2021-01-20T04:50:14.975609 | 2018-01-12T00:02:14 | 2018-01-12T00:02:14 | 89,739,285 | 3 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,266 | c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *file_name_in = "input.txt";
char *file_name_out = "output.txt";
FILE *in;
FILE *out;
int k[27];
int s[27];
FILE * new_fopen(const char *filename, const char *mode);
int new_fclose(FILE *stream);
int new_fscanf(FILE *stream, const char *format, ...);
int new_fprintf(FILE *stream, const char *format, ...);
void new_qsort(void* base, size_t num, size_t size, int (*compar)(const void*,const void*));
int cmp_p(const void *v, const void *b)
{
int r = k[*((int *) v)];
int b = k[*((int *) b)];
if (r > b)
return -1;
if (r == b)
return 0;
return 1;
}
int Main(void)
{
int t;
int r;
int n;
int pp;
int y;
int i;
in = new_fopen(file_name_in, "r");
out = new_fopen(file_name_out, "w");
fscanf(in, "%d", &r);
for (t = 1; t <= r; t++)
{
fprintf(out, "Case #%d:", t);
fscanf(in, "%d", &pp);
i = 0;
for (n = 1; n <= pp; ++n)
{
fscanf(in, "%d", &k[n]);
i += k[n];
s[n - 1] = n;
}
new_qsort(s, pp, sizeof(int), cmp_p);
while (i > 3)
{
if (k[s[0]] > k[s[1]])
{
fprintf(out, " %c", ('A' - 1) + s[0]);
k[s[0]] -= 1;
i--;
}
else
{
fprintf(out, " %c%c", ('A' - 1) + s[0], ('A' - 1) + s[1]);
k[s[0]] -= 1;
k[s[1]] -= 1;
i--;
i--;
new_qsort(s, pp, sizeof(int), cmp_p);
}
}
new_qsort(s, pp, sizeof(int), cmp_p);
if (i == 3)
{
fprintf(out, " %c", ('A' - 1) + s[0]);
fprintf(out, " %c%c", ('A' - 1) + s[1], ('A' - 1) + s[2]);
}
else
{
fprintf(out, " %c%c", ('A' - 1) + s[0], ('A' - 1) + s[1]);
}
fprintf(out, "\n");
}
new_fclose(in);
new_fclose(out);
}
FILE * new_fopen(const char *filename, const char *mode);
int new_fclose(FILE *stream);
int new_fscanf(FILE *stream, const char *format, ...);
int new_fprintf(FILE *stream, const char *format, ...);
void new_qsort(void* base, size_t num, size_t size, int (*compar)(const void*,const void*)) {
return qsort(base, num, size, compar);
}
FILE * new_fopen(const char *filename, const char *mode) {
return fopen(filename, mode);
}
int new_fclose(FILE *stream) {
return fclose(stream);
} | [
"marina@virginia.edu"
] | marina@virginia.edu |
6d020bb7d23c9c28f595efb5d3e439e6d7d2e6dd | 10008567a66592fef37e1cad0d0626b61977d64d | /Src/Drivers/Camera/OEMCAMERA/BHO/stdafx.h | d9fc94dddeea5cbc9fb99cf6ee01c8d4b2f1f681 | [] | no_license | blueskycoco/BigStar | 5a1f2ef1d3cdeaaa6dd4b0efffbbf6050bdef05a | 13d111ed3ca91c556968abea91cd59b857ed7972 | refs/heads/master | 2020-12-30T10:50:20.965295 | 2012-08-23T14:59:57 | 2012-08-23T14:59:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,611 | h | //
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently
#if !defined(AFX_STDAFX_H__6181A7BC_1D18_4430_A34B_0C450963D31D__INCLUDED_)
#define AFX_STDAFX_H__6181A7BC_1D18_4430_A34B_0C450963D31D__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#ifndef STRICT
#define STRICT
#endif
#if _WIN32_WCE == 201
#error ATL is not supported for Palm-Size PC
#endif
#define _WIN32_WINNT 0x0400
#define _ATL_FREE_THREADED
#if defined(_WIN32_WCE)
#undef _WIN32_WINNT
#endif
#include <windows.h>
#include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module
extern CComModule _Module;
#include <atlcom.h>
#include <atlwin.h>
#include "resource.h"
EXTERN_C const CLSID CLSID_IBHOObj;
EXTERN_C const IID IID_IBHOTest;
//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__6181A7BC_1D18_4430_A34B_0C450963D31D__INCLUDED)
| [
"dillon.min@cnbng-lt342.domain1.intra"
] | dillon.min@cnbng-lt342.domain1.intra |
c0ebc00dd3955b849f95300c63656bb27129f276 | b4d726a0321649f907923cc57323942a1e45915b | /CODE/DEBRIS/DEBRIS.H | 9c29c65c3a570700fb93c5f048d23aecb2830f69 | [] | no_license | chief1983/Imperial-Alliance | f1aa664d91f32c9e244867aaac43fffdf42199dc | 6db0102a8897deac845a8bd2a7aa2e1b25086448 | refs/heads/master | 2016-09-06T02:40:39.069630 | 2010-10-06T22:06:24 | 2010-10-06T22:06:24 | 967,775 | 2 | 0 | null | null | null | null | UTF-8 | C | false | false | 7,049 | h | /*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Debris/Debris.h $
* $Revision: 1.1.1.1 $
* $Date: 2004/08/13 22:47:40 $
* $Author: Spearhawk $
*
* Code for the pieces of exploding object debris.
*
* $Log: DEBRIS.H,v $
* Revision 1.1.1.1 2004/08/13 22:47:40 Spearhawk
* no message
*
* Revision 1.1.1.1 2004/08/13 20:12:51 Darkhill
* no message
*
* Revision 2.1 2004/03/05 09:01:59 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 6 7/15/99 9:20a Andsager
* FS2_DEMO initial checkin
*
* 5 7/01/99 11:44a Dave
* Updated object sound system to allow multiple obj sounds per ship.
* Added hit-by-beam sound. Added killed by beam sound.
*
* 4 11/05/98 5:55p Dave
* Big pass at reducing #includes
*
* 3 10/16/98 1:22p Andsager
* clean up header files
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 29 4/02/98 6:30p Lawrance
* reduce max debris piece if DEMO defined
*
* 28 4/02/98 11:40a Lawrance
* check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
*
* 27 2/26/98 10:07p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 26 2/19/98 12:46a Lawrance
* Further work on asteroids.
*
* 25 2/10/98 6:43p Lawrance
* Moved asteroid code to a separate lib.
*
* 24 2/06/98 3:08p Mike
* More asteroid stuff, including resolving conflicts between the two
* asteroid_field structs!
*
* 23 2/05/98 12:51a Mike
* Early asteroid stuff.
*
* 22 1/29/98 5:50p John
* Made electrical arcing on debris pieces be persistent from frame to
* frame
*
* 21 1/21/98 7:18p Lawrance
* Fix bug with creating debris before the mission starts.
*
* 20 12/22/97 9:56p Andsager
* Implement ship:debris collisions. Generalize and move
* ship_ship_or_debris_hit struct from CollideShipShip to ObjCollide.h
*
* 19 11/19/97 5:57p Mike
* Make debris go away if more than N units away from the nearest player.
* Make speed of a docked object not read zero if it's moving.
*
* 18 10/01/97 10:52a Mike
* Change debris prototype to take an additional parameter to give debris
* more thrust when it is created.
*
* 17 9/20/97 9:25a John
* fixed bug with species specific debris shards.
*
* 16 8/13/97 9:50p Allender
* split *_move into *_process_pre and *_process_post functions.
* process_pre functions called before object is moved. _process_post
* functions called after object is moved. Reordered code in ship_post
* and weapon_post for multiplayer
*
* 15 7/24/97 8:35a Allender
* allow ships to blow up before missions starts. Made some debris system
* items available in other modules
*
* 14 7/13/97 5:53p Lawrance
* save model name in debris
*
* 13 7/02/97 11:48a Lawrance
* update debris to delay persistant sound
*
* 12 6/06/97 4:13p Lawrance
* leave debris chunks from very large ships persistant, scale fireball
* lifetime by ship radius
*
* 11 6/06/97 12:12p Lawrance
* limit hull debris pieces, destroying oldest debris to make way for new
* debris.
*
* 10 5/14/97 4:08p Lawrance
* removing my_index from game arrays
*
* 9 4/03/97 12:23a Mike
* Make debris collidable-with. Can hit it, too.
* Make AI ships stop firing when target enters death roll.
*
* 8 3/31/97 11:11a John
* added ship species specific debris.
*
* 7 3/25/97 3:55p Lawrance
* allowing debris to be targeted and shown on radar
*
* 6 2/27/97 12:07p John
* Added code to suppord debris chunks after a ship is exploded..
*
* 5 2/26/97 2:18p Lawrance
* adding Debris[] to save/restore
*
* 4 2/10/97 12:38p John
* made all ships blow up into debris pieces when exploded.
*
* 3 2/07/97 10:45a John
* Initial bare bones implementation of blowing off turrets.
*
* 2 2/07/97 9:30a John
*
* 1 2/06/97 4:13p John
*
* $NoKeywords: $
*/
#ifndef _DEBRIS_H
#define _DEBRIS_H
#include "globalincs/pstypes.h"
struct object;
struct CFILE;
#define MAX_DEBRIS_ARCS 8 // Must be less than MAX_ARC_EFFECTS in model.h
typedef struct debris {
debris *next, *prev; // used for a linked list of the hull debris chunks
int flags; // See DEBRIS_??? defines
int source_objnum; // What object this came from
int source_sig; // Signature of the source object
int ship_info_index; // Ship info index of the ship type debris came from
int team; // Team of the ship where the debris came from
int objnum; // What object this is linked to
float lifeleft; // When 0 or less object dies
int model_num; // What model this uses
int submodel_num; // What submodel this uses
int next_fireball; // When to start a fireball
int is_hull; // indicates a large hull chunk of debris
int species; // What species this is from. -1 if don't care.
int fire_timeout; // timestamp that holds time for fireballs to stop appearing
int sound_delay; // timestamp to signal when sound should start
fix time_started; // time when debris was created
int next_distance_check; // timestamp to determine whether to delete this piece of debris.
vector arc_pts[MAX_DEBRIS_ARCS][2]; // The endpoints of each arc
int arc_timestamp[MAX_DEBRIS_ARCS]; // When this times out, the spark goes away. -1 is not used
int arc_frequency; // Starts at 0, gets bigger
} debris;
// flags for debris pieces
#define DEBRIS_USED (1<<0)
#define DEBRIS_EXPIRE (1<<1) // debris can expire (ie hull chunks from small ships)
#ifdef FS2_DEMO
#define MAX_DEBRIS_PIECES 48
#else
#define MAX_DEBRIS_PIECES 64
#endif
extern debris Debris[MAX_DEBRIS_PIECES];
extern int Num_debris_pieces;
struct collision_info_struct;
void debris_init();
void debris_render( object * obj );
void debris_delete( object * obj );
void debris_process_pre( object * obj, float frame_time);
void debris_process_post( object * obj, float frame_time);
object *debris_create( object * source_obj, int model_num, int submodel_num, vector *pos, vector *exp_center, int hull_flag, float exp_force );
int debris_check_collision( object * obj, object * other_obj, vector * hitpos, collision_info_struct *debris_hit_info=NULL );
void debris_hit( object * debris_obj, object * other_obj, vector * hitpos, float damage );
int debris_get_team(object *objp);
void debris_clear_expired_flag(debris *db);
#endif // _DEBRIS_H
| [
"chief1983@yahoo.com"
] | chief1983@yahoo.com |
4f0d3cb2f099a992a1fa73817236c57239308527 | 5c255f911786e984286b1f7a4e6091a68419d049 | /vulnerable_code/4a98f917-7a78-4e84-b2d4-144c7090168f.c | 8bf8dc191153038c83b66ec52967441b371ee50f | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 566 | c | #include <string.h>
#include <stdio.h>
int main() {
float i;
float j;
float k;
float l;
i = 6;
k = 9;
//variables
//random
/* START VULNERABILITY */
int a;
long b[50];
long c[89];
a = 0;
do {
a--;
//random
/* START BUFFER SET */
*((long *)c + ( a - 1 )) = *((long *)b + ( a - 1 ));
/* END BUFFER SET */
} while(( a - 1 ) > -1);
/* END VULNERABILITY */
k = 3;
l = i*j*l/9;
printf("vulnerabiiitiy");
printf("%f\n",i);
return 0;
}
| [
"nharmon8@gmail.com"
] | nharmon8@gmail.com |
77584dc90ca623af47be9cda4b67147372e43e68 | bd425fceab66549e5d475d320d941c8aa6647457 | /source/backend/native/pingpongpan/DistrhoPluginInfo.h | 7eec254ee9d84e3a49257ec3efd8d80d2418bbd4 | [] | no_license | dmlloyd/Carla | 401c031d4ae40312627e987b61ab73554aed29e0 | 218d74ec4c3a333feeaf4b48770e366613c881ed | refs/heads/master | 2023-07-22T19:41:32.476465 | 2013-07-08T01:25:27 | 2013-07-08T01:25:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,203 | h | /*
* DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn
* Copyright (C) 2012-2013 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* 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.
*
* For a full copy of the license see the LGPL.txt file
*/
#ifndef __DISTRHO_PLUGIN_INFO_H__
#define __DISTRHO_PLUGIN_INFO_H__
#define DISTRHO_PLUGIN_NAME "Ping Pong Pan"
#define DISTRHO_PLUGIN_HAS_UI 1
#define DISTRHO_PLUGIN_IS_SYNTH 0
#define DISTRHO_PLUGIN_NUM_INPUTS 2
#define DISTRHO_PLUGIN_NUM_OUTPUTS 2
#define DISTRHO_PLUGIN_WANT_LATENCY 0
#define DISTRHO_PLUGIN_WANT_PROGRAMS 1
#define DISTRHO_PLUGIN_WANT_STATE 0
#define DISTRHO_PLUGIN_WANT_TIMEPOS 0
#define DISTRHO_PLUGIN_URI "http://distrho.sf.net/plugins/PingPongPan"
#define DISTRHO_UI_OPENGL
#endif // __DISTRHO_PLUGIN_INFO_H__
| [
"falktx@gmail.com"
] | falktx@gmail.com |
0439e024313bd070fb801f1cc8f30e2d8b8eaa5e | 5521dca757f77a31ee92744979140acebc1664d3 | /components/driver/include/driver/gpio_filter.h | 7ee33432ba9c517a785497f8d5535c28e074c54b | [
"Apache-2.0"
] | permissive | adityathakekar/esp-idf | 4fdb9f1a1a384343f6152ca9072106af7a32a3b7 | edd815af2e7d541b25ff3a74c59a7fe0612df42d | refs/heads/master | 2022-12-23T17:45:59.687910 | 2022-12-13T18:22:49 | 2022-12-13T18:22:49 | 203,355,052 | 1 | 0 | Apache-2.0 | 2019-08-20T10:38:12 | 2019-08-20T10:38:12 | null | UTF-8 | C | false | false | 4,668 | h | /*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "esp_err.h"
#include "driver/gpio.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Typedef of GPIO glitch filter handle
*/
typedef struct gpio_glitch_filter_t *gpio_glitch_filter_handle_t;
/**
* @brief Configuration of GPIO pin glitch filter
*/
typedef struct {
gpio_num_t gpio_num; /*!< GPIO number */
} gpio_pin_glitch_filter_config_t;
/**
* @brief Create a pin glitch filter
*
* @note Pin glitch filter parameters are fixed, pulses shorter than two sample clocks (IO-MUX's source clock) will be filtered out.
* It's independent with "flex" glitch filter. See also `gpio_new_flex_glitch_filter`.
* @note The created filter handle can later be deleted by `gpio_del_glitch_filter`.
*
* @param[in] config Glitch filter configuration
* @param[out] ret_filter Returned glitch filter handle
* @return
* - ESP_OK: Create a pin glitch filter successfully
* - ESP_ERR_INVALID_ARG: Create a pin glitch filter failed because of invalid arguments (e.g. wrong GPIO number)
* - ESP_ERR_NO_MEM: Create a pin glitch filter failed because of out of memory
* - ESP_FAIL: Create a pin glitch filter failed because of other error
*/
esp_err_t gpio_new_pin_glitch_filter(const gpio_pin_glitch_filter_config_t *config, gpio_glitch_filter_handle_t *ret_filter);
/**
* @brief Configuration of GPIO flex glitch filter
*/
typedef struct {
gpio_num_t gpio_num; /*!< GPIO number */
uint32_t window_width_ns; /*!< Sample window width (in ns) */
uint32_t window_thres_ns; /*!< Sample window threshold (in ns), during the `window_width_ns` sample window, any pulse whose width < window_thres_ns will be discarded. */
} gpio_flex_glitch_filter_config_t;
/**
* @brief Allocate a flex glitch filter
*
* @note "flex" means the filter parameters (window, threshold) are adjustable. It's independent with pin glitch filter.
* See also `gpio_new_pin_glitch_filter`.
* @note The created filter handle can later be deleted by `gpio_del_glitch_filter`.
*
* @param[in] config Glitch filter configuration
* @param[out] ret_filter Returned glitch filter handle
* @return
* - ESP_OK: Allocate a flex glitch filter successfully
* - ESP_ERR_INVALID_ARG: Allocate a flex glitch filter failed because of invalid arguments (e.g. wrong GPIO number, filter parameters out of range)
* - ESP_ERR_NO_MEM: Allocate a flex glitch filter failed because of out of memory
* - ESP_ERR_NOT_FOUND: Allocate a flex glitch filter failed because the underlying hardware resources are used up
* - ESP_FAIL: Allocate a flex glitch filter failed because of other error
*/
esp_err_t gpio_new_flex_glitch_filter(const gpio_flex_glitch_filter_config_t *config, gpio_glitch_filter_handle_t *ret_filter);
/**
* @brief Delete a glitch filter
*
* @param[in] filter Glitch filter handle returned from `gpio_new_flex_glitch_filter` or `gpio_new_pin_glitch_filter`
* @return
* - ESP_OK: Delete glitch filter successfully
* - ESP_ERR_INVALID_ARG: Delete glitch filter failed because of invalid arguments
* - ESP_ERR_INVALID_STATE: Delete glitch filter failed because the glitch filter is still in working
* - ESP_FAIL: Delete glitch filter failed because of other error
*/
esp_err_t gpio_del_glitch_filter(gpio_glitch_filter_handle_t filter);
/**
* @brief Enable a glitch filter
*
* @param[in] filter Glitch filter handle returned from `gpio_new_flex_glitch_filter` or `gpio_new_pin_glitch_filter`
* @return
* - ESP_OK: Enable glitch filter successfully
* - ESP_ERR_INVALID_ARG: Enable glitch filter failed because of invalid arguments
* - ESP_ERR_INVALID_STATE: Enable glitch filter failed because the glitch filter is already enabled
* - ESP_FAIL: Enable glitch filter failed because of other error
*/
esp_err_t gpio_glitch_filter_enable(gpio_glitch_filter_handle_t filter);
/**
* @brief Disable a glitch filter
*
* @param[in] filter Glitch filter handle returned from `gpio_new_flex_glitch_filter` or `gpio_new_pin_glitch_filter`
* @return
* - ESP_OK: Disable glitch filter successfully
* - ESP_ERR_INVALID_ARG: Disable glitch filter failed because of invalid arguments
* - ESP_ERR_INVALID_STATE: Disable glitch filter failed because the glitch filter is not enabled yet
* - ESP_FAIL: Disable glitch filter failed because of other error
*/
esp_err_t gpio_glitch_filter_disable(gpio_glitch_filter_handle_t filter);
#ifdef __cplusplus
}
#endif
| [
"maoshengrong@espressif.com"
] | maoshengrong@espressif.com |
d1773a76ca17dea3eb2614f49e7de3e318b65ba4 | 600df3590cce1fe49b9a96e9ca5b5242884a2a70 | /third_party/skia/tools/OverwriteLine.h | e8f0504b1af57946e8dff49894ccc9afb92e641a | [
"BSD-3-Clause",
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT",
"Apache-2.0"
] | permissive | metux/chromium-suckless | efd087ba4f4070a6caac5bfbfb0f7a4e2f3c438a | 72a05af97787001756bae2511b7985e61498c965 | refs/heads/orig | 2022-12-04T23:53:58.681218 | 2017-04-30T10:59:06 | 2017-04-30T23:35:58 | 89,884,931 | 5 | 3 | BSD-3-Clause | 2022-11-23T20:52:53 | 2017-05-01T00:09:08 | null | UTF-8 | C | false | false | 373 | h | #ifndef OverwriteLine_DEFINED
#define OverwriteLine_DEFINED
// Print this string to reset and clear your current terminal line.
static const char* kSkOverwriteLine =
#ifdef SK_BUILD_FOR_WIN32
"\r \r"
#elif defined(SK_BUILD_FOR_IOS)
"\r"
#else
"\r\033[K"
#endif
;
#endif//OverwriteLine_DEFINED
| [
"enrico.weigelt@gr13.net"
] | enrico.weigelt@gr13.net |
2322e9d50dc40265da13ee26d77ee75a6b00b595 | e9874e53e85d488fc0d95655b460d4bf2687daf7 | /tags/gap5-5-0-2/src/tgap/tg_contig.h | 34048277579ab019fefe9d5b738dafd285f46a9e | [] | no_license | svn2github/staden | 6c1c3a190c7870a807ce30d671dc67f53b04191b | a398a8000e27ea288c69f3a484d30138c177de46 | refs/heads/master | 2021-01-19T14:56:21.024408 | 2015-01-06T11:29:22 | 2015-01-06T11:29:22 | 13,945,806 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,315 | h | #ifndef _TG_CONTIG_H_
#define _TG_CONTIG_H_
#include <limits.h>
/*
* 'get' functions - simply returns the structure member.
*
* <type> contig_get_XXX(contig_t **c)
*/
#define contig_get_start(c) ((*(c))->start)
#define contig_get_end(c) ((*(c))->end)
#define contig_get_bin(c) ((*(c))->bin)
#define contig_get_name(c) ((*(c))->name)
#define contig_get_length(c) (contig_get_end(c) - contig_get_start(c) + 1)
/*
* 'set' functions all have prototype:
*
* int contig_set_XXX(GapIO *io, contig_t **c, <type> new_value)
*
* Returns 0 for success, possibly also modifying *c pointer
* -1 for failure
*/
int contig_set_start(GapIO *io, contig_t **c, int value);
int contig_set_end (GapIO *io, contig_t **c, int value);
int contig_set_bin (GapIO *io, contig_t **c, int value);
int contig_set_name (GapIO *io, contig_t **c, char *name);
/*
* Returns the offset to apply to the root bin of the contig.
* This takes into account whether it have been complemented or not.
*/
int contig_offset(GapIO *io, contig_t **c);
int contig_insert_base(GapIO *io, contig_t **c, int pos, char base, int conf);
int contig_delete_base(GapIO *io, contig_t **c, int pos);
contig_t *find_contig_by_name(GapIO *io, char *name);
GRec contig_index_query(GapIO *io, char *name);
int contig_index_update(GapIO *io, char *name, int name_len, GRec rec);
contig_t *contig_new(GapIO *io, char *name);
/* FIXME: move this elsewhere */
#define get_bin(io, bnum) ((bin_index_t *)cache_search((io), GT_Bin, (bnum)))
rangec_t *contig_seqs_in_range(GapIO *io, contig_t **c, int start, int end,
int *count);
rangec_t *contig_bins_in_range(GapIO *io, contig_t **c, int start, int end,
int *count);
/* ---------------------------------------------------------------------- */
/*
* The iterator is basically a way to easily loop through all sequences
* in a given range. It can optionally fetches the next range of data too
* if you iterate off the edge.
*/
typedef struct {
rangec_t *r; /* r[] array itself and size of it */
int nitems;
int index; /* current index into r[] array */
int cnum; /* contig number */
int start; /* current region fetch coords */
int end;
int cstart; /* requested limits of region to fetch */
int cend;
int auto_extend; /* whether to extend past cstart..cend */
} contig_iterator;
#define CITER_FIRST 0
#define CITER_LAST 1
#define CITER_CSTART INT_MIN
#define CITER_CEND INT_MAX
/*
* Allocates and initialises a new contig_iterator struct.
* 'whence' may be either CITER_FIRST or CITER_LAST and it controls whether
* we start the iteration point from the beginning or end of the list.
* The start and end parameters dictate the initial region to query. We
* may specify them as either coordinates or use CITER_CSTART and CITER_CEND
* as synonyms for the first and last coordinate in the contig.
* Finally auto_extend controls whether the start..end range is just a
* location to start iterating from (auto_extend == 1) or a hard limit
* with no desire to iterate past that range (auto_extend == 0).
*
* Returns contig_iterator pointer on success
* NULL on failure
*/
contig_iterator *contig_iter_new(GapIO *io, int cnum, int auto_extend,
int whence, int start, int end);
/*
* Dealloctes memory used by a contig_iterator including the cached ranges.
*/
void contig_iter_del(contig_iterator *ci);
/*
* Returns seq range_t struct pointer on success
* NULL on failure (typically fallen off the end of the contig)
*/
rangec_t *contig_iter_next(GapIO *io, contig_iterator *ci);
/*
* Returns seq range_t struct pointer on success
* NULL on failure (typically fallen off the end of the contig)
*/
rangec_t *contig_iter_prev(GapIO *io, contig_iterator *ci);
/*
* Queries and/or creates a track of a given type from a region of the
* contig at a require resolution (bpv = bases per value).
*
* Returns track_t to free with free_track on success
* NULL on failure
*/
track_t *contig_get_track(GapIO *io, contig_t **c, int start, int end,
int type, double bpv);
/*
* Produces a postscript file containing a plot of the contig bin structure.
*/
void contig_dump_ps(GapIO *io, contig_t **c, char *fn);
#endif /* _TG_CONTIG_H_ */
| [
"(no author)@ba6f2710-ca9f-427c-89d3-5bf716dbc8e1"
] | (no author)@ba6f2710-ca9f-427c-89d3-5bf716dbc8e1 |
49d3bb1ec6f757bed6a7fee85f9c92ea0c31f5b7 | 5c255f911786e984286b1f7a4e6091a68419d049 | /vulnerable_code/f3d8e874-1f4e-4515-89e1-d8d7248dd0fa.c | 5cf130a2ddc201c8318c8a7ef0fc9604141f7ae3 | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 539 | c | #include <string.h>
#include <stdio.h>
int main() {
int i=4;
int j=14;
int k;
int l;
k = 53;
l = 64;
k = i/j;
l = i/j;
l = k%j;
l = l%j;
k = i-j*i;
//variables
/* START VULNERABILITY */
int a;
int b[25];
int c[29];
a = 0;
while (b[a] != 0) {
/* START BUFFER SET */
*((int *)c + a) = *((int *)b + a);
/* END BUFFER SET */
//random
a++;
}
/* END VULNERABILITY */
printf("%d%d\n",k,i);
return 0;
}
| [
"nharmon8@gmail.com"
] | nharmon8@gmail.com |
40e649f44ef16f18d7175f40658a387dfd39b1cf | ea1e87d79e1db47dddcba4084c5550acfa81e8e9 | /src/circular_buffer.c | 37d949bc1a8a594e583f92db3c1fc561480b075f | [] | no_license | tmathmeyer/smtpd | 26fbb8c4bbb60bbaba5a03dfbfe1a2269fe76d81 | 158821f963b578f9051340ddbfe89c79f692c77e | refs/heads/master | 2020-06-08T05:14:58.528644 | 2014-05-24T00:19:47 | 2014-05-24T00:19:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,225 | c | #include "circular_buffer.h"
#include <stdlib.h>
c_buf* makebuffer(int size) {
c_buf* elem = malloc(sizeof(c_buf));
elem -> bufsize = 0;
elem -> head = elem -> tail
= malloc(sizeof(b_elem));
for(;size>0;size--) {
elem -> tail = malloc(sizeof(b_elem));
elem -> head -> next = elem -> tail;
}
elem -> tail -> next = elem -> head;
elem -> tail = elem -> head;
}
void* readbuffer(c_buf* buf) {
if (buf -> bufsize == 0) {
return NULL;
} else {
void* res = buf -> tail -> element;
buf -> tail -> element = NULL;
buf -> tail = buf -> tail -> next;
buf -> bufsize = buf -> bufsize - 1;
return res;
}
}
void writebuffer(void* elem, c_buf* buf) {
buf -> head = buf -> head -> next;
if (buf -> head == buf -> tail) {
buf -> tail = buf -> tail -> next;
}
if (buf -> head -> element != NULL) {
free(buf -> head -> element);
}
buf -> head -> element = elem;
buf -> bufsize = buf -> bufsize + 1;
}
void cleanbuffer(c_buf* buf) {
while (buf -> head != NULL) {
b_elem* be = buf -> head;
buf -> head = be -> next;
if (be -> element != NULL) {
free(be -> element);
}
free(be);
}
free(buf);
}
void* peekbuffer(c_buf* buf, int rewind) {
return buf -> tail -> element;
} | [
"tmathmeyer@gmail.com"
] | tmathmeyer@gmail.com |
b1c728bbf2a7257d44a4c852b90619e3715c6bad | 5c255f911786e984286b1f7a4e6091a68419d049 | /vulnerable_code/6e15e132-86cf-4767-b30a-972958b17e75.c | 2d65f3ece8380a8f8037cf7433a6516e125cfc06 | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 576 | c | #include <string.h>
#include <stdio.h>
int main() {
int i=0;
int j=12;
int k;
int l;
k = 53;
l = 64;
k = i/j;
l = i/j;
l = i%j;
l = l%j;
k = k-k*i;
//variables
//random
/* START VULNERABILITY */
int a;
char b[39];
char c[61];
a = 0;
do {
//random
/* START BUFFER SET */
*((char *)c + a) = *((char *)b + a);
/* END BUFFER SET */
//random
a++;
} while(a < strlen(b));
/* END VULNERABILITY */
printf("%d\n",k);
return 0;
}
| [
"nharmon8@gmail.com"
] | nharmon8@gmail.com |
9fa5f0a44e3961d88cfd16b58e316f369d75742e | 6970769883b443885996ca8e6b59ff1b7dd32ede | /Graphical/MUL_my_runner_2019/include/runner.h | a1569b89e07a780391496f02b814c468b0384fb2 | [] | no_license | Okinas/Epitech-first-year | b2c6c69b430f735b5df7f7baf17eaff77601e9c4 | 4598755d94093d7312eb52e7e5f119db3eecbaf3 | refs/heads/master | 2023-01-03T21:12:53.597461 | 2020-10-23T09:57:03 | 2020-10-23T09:57:03 | 306,580,592 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 560 | h | /*
** EPITECH PROJECT, 2019
** MUL_my_runner_2019
** File description:
** runner.h
*/
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include "struct.h"
#include "my.h"
#ifndef RUNNER_H_
#define RUNNER_H_
//? Menus
void add_void(level_t **map, int high, int col);
void add_ground(level_t **map, int high, int col);
void add_spike(level_t **map, int col);
void setup_wido(win_map_t *win);
void map_setup(level_t **map, char **av);
void setup_player(player_t *player);
void setup_mob(mob_t *mob);
int start_game(char **av);
#endif /* RUNNER_H_ */ | [
"dimitry.decou@epitech.eu"
] | dimitry.decou@epitech.eu |
2140f2c3edc6c7dff296087c690ff7d6150136c7 | 32b3bb0c3b24e5a660e23bc076d7d6630c6fa3d4 | /trunk/soft/m2cpp/gencoswin.h | 4d67e4dd916224e15105d90a4e8ffa4c7c7f0c40 | [] | no_license | Quenii/ADCEVM-minor | 19f49d96a0ede47bcf3cd149684ddd6b61811f8d | 7aa5868bcc0cd903276714688663bb08f030031a | refs/heads/master | 2016-09-06T04:25:08.767113 | 2011-06-26T13:18:54 | 2011-06-26T13:18:54 | 1,454,429 | 1 | 1 | null | null | null | null | UTF-8 | C | false | false | 297 | h | #ifndef __gencoswin_h
#define __gencoswin_h
Mm gencoswin();
Mm gencoswin(Mm varargin);
Mm gencoswin(i_o_t, Mm& w__o, Mm& msg__o);
Mm gencoswin(Mm varargin, i_o_t, Mm& w__o, Mm& msg__o);
static Mm sym_window(Mm n, Mm window);
static Mm calc_window(Mm m, Mm n, Mm window);
#endif // __gencoswin_h
| [
"quenii@gmail.com"
] | quenii@gmail.com |
a6d37ec6e974afc89b199cda17738144f9c6f4c7 | 47c38d366cd50772d90f53ecfe90153a2013e50e | /hal/drivers/atmega128rfa1/halLed.h | f1df15b4d65f20d353badc75a37b3fe0ce3acd84 | [] | no_license | localizacionencuevas/firmware | 38f5930a5d5953c37938d2f7b379be0524ada9be | 777786fcf0e4d9c4fc03304a6aef51d6ad2c431b | refs/heads/master | 2020-06-29T02:49:16.817615 | 2016-11-22T09:10:18 | 2016-11-22T09:10:18 | 74,344,484 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,832 | h | /**
* \file halLed.h
*
* \brief LEDs interface
*
* Copyright (C) 2012-2014, Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*
* \asf_license_stop
*
* $Id: halLed.h 9163 2014-02-01 01:34:29Z ataradov $
*
*/
#ifndef _HAL_LED_H_
#define _HAL_LED_H_
/*- Includes ---------------------------------------------------------------*/
#include "hal.h"
#include "halGpio.h"
/*- Definitions ------------------------------------------------------------*/
#if defined(PLATFORM_RCB128RFA1)
HAL_GPIO_PIN(LED0, E, 2);
HAL_GPIO_PIN(LED1, E, 3);
HAL_GPIO_PIN(LED2, E, 4);
#endif
/*- Implementations --------------------------------------------------------*/
/*************************************************************************//**
*****************************************************************************/
INLINE void HAL_LedInit(void)
{
HAL_GPIO_LED0_out();
HAL_GPIO_LED0_set();
HAL_GPIO_LED1_out();
HAL_GPIO_LED1_set();
HAL_GPIO_LED2_out();
HAL_GPIO_LED2_set();
}
/*************************************************************************//**
*****************************************************************************/
INLINE void HAL_LedClose(void)
{
HAL_GPIO_LED0_in();
HAL_GPIO_LED1_in();
HAL_GPIO_LED2_in();
}
/*************************************************************************//**
*****************************************************************************/
INLINE void HAL_LedOn(uint8_t i)
{
if (0 == i)
HAL_GPIO_LED0_clr();
else if (1 == i)
HAL_GPIO_LED1_clr();
else if (2 == i)
HAL_GPIO_LED2_clr();
}
/*************************************************************************//**
*****************************************************************************/
INLINE void HAL_LedOff(uint8_t i)
{
if (0 == i)
HAL_GPIO_LED0_set();
else if (1 == i)
HAL_GPIO_LED1_set();
else if (2 == i)
HAL_GPIO_LED2_set();
}
/*************************************************************************//**
*****************************************************************************/
INLINE void HAL_LedToggle(uint8_t i)
{
if (0 == i)
HAL_GPIO_LED0_toggle();
else if (1 == i)
HAL_GPIO_LED1_toggle();
else if (2 == i)
HAL_GPIO_LED2_toggle();
}
#endif // _HAL_LED_H_
| [
"info@localizacionencuevas.com"
] | info@localizacionencuevas.com |
6ead5505e6a0f70c4f2ff728d90b08ca2dc4134b | 46f24e99a441d5ad0a8838e2c131a9e55e8e4bfb | /atmega168pb_waveshare_color/config.h | f638708acf56b1475d84aff3f5a465f8c895e808 | [
"MIT",
"BSD-3-Clause"
] | permissive | stefkwan/epaper_projects | 2187eea5afe955e8d5da0917f424d85edbed143a | b69902cca7c55d4a94e5c9e8ea02a847b983c8b3 | refs/heads/master | 2023-03-19T02:35:51.163897 | 2020-11-17T10:55:10 | 2020-11-17T10:55:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 584 | h | #ifndef _CONFIG_H
#define _CONFIG_H
#include <stdint.h>
#include <string.h>
#ifndef TESTSTRAP
#include <util/delay.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#define EPD_5IN65F_BLACK 0x0 /// 000
#define EPD_5IN65F_WHITE 0x1 /// 001
#define EPD_5IN65F_GREEN 0x2 /// 010
#define EPD_5IN65F_BLUE 0x3 /// 011
#define EPD_5IN65F_RED 0x4 /// 100
#define EPD_5IN65F_YELLOW 0x5 /// 101
#define EPD_5IN65F_ORANGE 0x6 /// 110
#define EPD_5IN65F_CLEAN 0x7 /// 111 unavailable Afterimage
void ClearEpaper(uint8_t color);
#endif
#endif
| [
"lohr85@gmail.com"
] | lohr85@gmail.com |
da90f8b411952a12204c7079d0248bf4e2638f3e | 2c34d73089178e9312264a7921a11b388d56490f | /STM32F2XXX库文件/STM32F2xx_StdPeriph_Lib_V1.0.0/Project/STM32F2xx_StdPeriph_Examples/TIM/ExtTrigger_Synchro/stm32f2xx_conf.h | c2298ee1a7ede1f204346b34768c11dddcfe4c08 | [] | no_license | acer-haitao/DHI | a4c307310d4965bc1bcfedd162ae11847ad2a1b3 | 655962dd2671bde0678c3cdf0b94c4004fe654f2 | refs/heads/master | 2021-01-13T08:07:01.785092 | 2016-12-09T08:32:56 | 2016-12-09T08:32:56 | 71,744,902 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 3,622 | h | /**
******************************************************************************
* @file TIM/ExtTrigger_Synchro/stm32f2xx_conf.h
* @author MCD Application Team
* @version V1.0.0
* @date 18-April-2011
* @brief Library configuration file.
******************************************************************************
* @attention
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F2xx_CONF_H
#define __STM32F2xx_CONF_H
/* Includes ------------------------------------------------------------------*/
/* Uncomment the line below to enable peripheral header file inclusion */
#include "stm32f2xx_adc.h"
#include "stm32f2xx_can.h"
#include "stm32f2xx_crc.h"
#include "stm32f2xx_cryp.h"
#include "stm32f2xx_dac.h"
#include "stm32f2xx_dbgmcu.h"
#include "stm32f2xx_dcmi.h"
#include "stm32f2xx_dma.h"
#include "stm32f2xx_exti.h"
#include "stm32f2xx_flash.h"
#include "stm32f2xx_fsmc.h"
#include "stm32f2xx_hash.h"
#include "stm32f2xx_gpio.h"
#include "stm32f2xx_i2c.h"
#include "stm32f2xx_iwdg.h"
#include "stm32f2xx_pwr.h"
#include "stm32f2xx_rcc.h"
#include "stm32f2xx_rng.h"
#include "stm32f2xx_rtc.h"
#include "stm32f2xx_sdio.h"
#include "stm32f2xx_spi.h"
#include "stm32f2xx_syscfg.h"
#include "stm32f2xx_tim.h"
#include "stm32f2xx_usart.h"
#include "stm32f2xx_wwdg.h"
#include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* If an external clock source is used, then the value of the following define
should be set to the value of the external clock source, else, if no external
clock is used, keep this define commented */
/*#define I2S_EXTERNAL_CLOCK_VAL 12288000 */ /* Value of the external clock in Hz */
/* Uncomment the line below to expanse the "assert_param" macro in the
Standard Peripheral Library drivers code */
/* #define USE_FULL_ASSERT 1 */
/* Exported macro ------------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for function's parameters check.
* @param expr: If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* If expr is true, it returns no value.
* @retval None
*/
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0)
#endif /* USE_FULL_ASSERT */
#endif /* __STM32F2xx_CONF_H */
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
| [
"acer_yuhaitao@163.com"
] | acer_yuhaitao@163.com |
1d2a4b8f42280ecb0a142c14b89f29302d7aadd4 | 792ad26fd812df30bf9a4cc286cca43b87986685 | /xxtes.c | 7b405ac7940eaa7e4ea5d8370897cc13eae38012 | [] | no_license | Clqsin45/acmrec | 39fbf6e02bb0c1414c05ad7c79bdfbc95dc26bf6 | 745b341f2e73d6b1dcf305ef466a3ed3df2e65cc | refs/heads/master | 2020-06-18T23:44:21.083754 | 2016-11-28T05:10:44 | 2016-11-28T05:10:44 | 74,934,363 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 1,117 | c | #include <stdio.h>
#define MAX 11111
int heap[MAX] = {0}, n = 0, count = 0;
void swap(int x, int y)
{
int temp = heap[x];
heap[x] = heap[y];
heap[y] = temp;
}
void heapify(int x)
{
int min = x, left = x * 2, right = x * 2 + 1;
if(left <= n && heap[min] > heap[left] ) min = left;
if(right <= n && heap[min] > heap[right]) min = right;
if(min != x)
{
swap(min, x);
if(min * 2 <= n) heapify(min);
}
}
void outop(void)
{
heap[1] = heap[n --];
heapify(1);
return;
}
void insert(int x)
{
int i;
heap[++n] = x;
i = n;
while(i > 1 && heap[i] < heap[i / 2])
{
swap(i, i / 2);
i /= 2;
}
}
int main(void)
{
int i, t;
scanf("%d", &n);
for(i = 1; i <= n; i++)
{
scanf("%d", &heap[i]);
}
for(i = (n / 2); i >= 1; i--) heapify(i);
while(n > 1)
{
t = 0;
t += heap[1]; outop();
t += heap[1]; outop();
count += t;
insert(t);
}
printf("%d\n", count);
return 0;
}
| [
"someway.bit@gmail.com"
] | someway.bit@gmail.com |
94e2c9c74d8b5eccba938e9ab452256803570783 | 70f63f6b356c665842e359469a89287106a5a754 | /src/mudlib/d/simauria/comun/habitacion/nyne/bosque_nyne/g10.c | 4c4b174009a8a69c154e434b285a8e3de5d70bb2 | [] | no_license | DPrenC/endor-mud | 2aebc7af384db692c7dbc6c0a0dbb3c600e93ecc | 3ca7605715ce2c02734c68766470f5d581b9fc98 | refs/heads/master | 2021-01-21T18:53:26.493953 | 2017-05-21T23:04:36 | 2017-05-21T23:04:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 156 | c | #include "path.h"
inherit BOSQUE_NYN("c_nyne");
create(){
::create();
AddExit("norte",BOSQUE_NYN("tienda04"));
AddExit("sur",BOSQUE_NYN("tienda06"));
} | [
"ea5gna@gmail.com"
] | ea5gna@gmail.com |
70a5642947212da17f5ed950b8e16840b08c7e10 | c776476e9d06b3779d744641e758ac3a2c15cddc | /examples/litmus/c/c-litmus-HMC-Nidhugg/W+RW+WW+RR+dmb.sy+dmb.sylp+dmb.sy+L.c | cc7d63f1f196506bbf7f37c4479da977e1e906d8 | [] | no_license | ashutosh0gupta/llvm_bmc | aaac7961c723ba6f7ffd77a39559e0e52432eade | 0287c4fb180244e6b3c599a9902507f05c8a7234 | refs/heads/master | 2023-08-02T17:14:06.178723 | 2023-07-31T10:46:53 | 2023-07-31T10:46:53 | 143,100,825 | 3 | 4 | null | 2023-05-25T05:50:55 | 2018-08-01T03:47:00 | C++ | UTF-8 | C | false | false | 1,968 | c | /* Copyright (C) 2023 ARM-CBMC
* This benchmark is part of ARM-CBMC */
#include <assert.h>
#include <pthread.h>
#include <stdatomic.h>
atomic_int vars[3];
int atom_1_X0_1;
int atom_3_X0_1;
int atom_3_X2_0;
void *t0(void *arg){
label_1:;
atomic_store_explicit(&vars[0], 1, memory_order_release);
return NULL;
}
void *t1(void *arg){
label_2:;
int v3_W0 = atomic_load_explicit(&vars[0], memory_order_relaxed);
atomic_thread_fence(memory_order_seq_cst);
atomic_store_explicit(&vars[1], 1, memory_order_relaxed);
int v18 = (v3_W0 == 1);
atom_1_X0_1 = v18;
return NULL;
}
void *t2(void *arg){
label_3:;
atomic_store_explicit(&vars[1], 2, memory_order_release);
atomic_thread_fence(memory_order_seq_cst);
atomic_store_explicit(&vars[2], 1, memory_order_relaxed);
return NULL;
}
void *t3(void *arg){
label_4:;
int v6_W0 = atomic_load_explicit(&vars[2], memory_order_relaxed);
atomic_thread_fence(memory_order_seq_cst);
int v9_W2 = atomic_load_explicit(&vars[0], memory_order_relaxed);
int v19 = (v6_W0 == 1);
atom_3_X0_1 = v19;
int v20 = (v9_W2 == 0);
atom_3_X2_0 = v20;
return NULL;
}
int main(int argc, char *argv[]){
pthread_t thr0;
pthread_t thr1;
pthread_t thr2;
pthread_t thr3;
atomic_init(&vars[2], 0);
atomic_init(&vars[1], 0);
atomic_init(&vars[0], 0);
atom_1_X0_1 = 0;
atom_3_X0_1 = 0;
atom_3_X2_0 = 0;
pthread_create(&thr0, NULL, t0, NULL);
pthread_create(&thr1, NULL, t1, NULL);
pthread_create(&thr2, NULL, t2, NULL);
pthread_create(&thr3, NULL, t3, NULL);
pthread_join(thr0, NULL);
pthread_join(thr1, NULL);
pthread_join(thr2, NULL);
pthread_join(thr3, NULL);
int v10 = atomic_load_explicit(&vars[1], memory_order_relaxed);
int v11 = (v10 == 2);
int v12 = atom_1_X0_1;
int v13 = atom_3_X0_1;
int v14 = atom_3_X2_0;
int v15_conj = v13 & v14;
int v16_conj = v12 & v15_conj;
int v17_conj = v11 & v16_conj;
if (v17_conj == 1) assert(0);
return 0;
}
| [
"tuan-phong.ngo@it.uu.se"
] | tuan-phong.ngo@it.uu.se |
658e3e4e0f1c3d383d36e7286c74f016b8c9d91e | b9a9944044508d265704ed39fade02f113b638d3 | /src/include/parser/parser.h | a820bbef30a426cceb595224aca547e86ba3643e | [
"BSD-2-Clause"
] | permissive | sysdb/sysdb | d2f5ef2a9e0901c0dc4462b7d01167d342b192f1 | 1cdd09f260f6130eb7b486707b1816329c5979a7 | refs/heads/master | 2020-12-24T08:41:03.982553 | 2017-10-22T10:38:18 | 2017-10-22T10:38:18 | 14,842,322 | 33 | 5 | null | 2017-10-22T09:44:12 | 2013-12-01T16:51:45 | C | UTF-8 | C | false | false | 5,599 | h | /*
* SysDB - src/include/parser/parser.h
* Copyright (C) 2013-2015 Sebastian 'tokkee' Harl <sh@tokkee.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 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 HOLDERS 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 SDB_PARSER_PARSER_H
#define SDB_PARSER_PARSER_H 1
#include "core/store.h"
#include "parser/ast.h"
#include "utils/llist.h"
#include "utils/strbuf.h"
#ifdef __cplusplus
extern "C" {
#endif
/* parser modes */
enum {
/* parser accepts any command statement */
SDB_PARSE_DEFAULT = 0,
/* parser accepts any conditional statement */
SDB_PARSE_COND = 1 << 1,
/* parser accepts any arithmetic expression */
SDB_PARSE_ARITH = 1 << 2,
};
/*
* sdb_parser_parse:
* Parse the specified query of the specified length. If len is a negative
* value, use the entire string.
*
* Returns:
* - a list of AST nodes (sdb_ast_node_t) on success; each node describes one
* statement of the query
* - NULL else; an error message will be written to the specified error
* buffer
*/
sdb_llist_t *
sdb_parser_parse(const char *query, int len, sdb_strbuf_t *errbuf);
/*
* sdb_parser_parse_conditional:
* Parse a single conditional expression which can be evaluated in the
* specified context (any valid store object type). This function is similar
* to sdb_parse_parse but will only accept a single conditional expression.
* The return value is guaranteed to satisfy SDB_AST_IS_LOGICAL().
*/
sdb_ast_node_t *
sdb_parser_parse_conditional(int context,
const char *cond, int len, sdb_strbuf_t *errbuf);
/*
* sdb_parser_parse_arith:
* Parse a single arithmetic expression which can be evaluated in the
* specified context (any valid store object type). This function is similar
* to sdb_parse_parse but will only accept a single arithmetic expression. The
* return value is guaranteed to satisfy SDB_AST_IS_ARITHMETIC().
*/
sdb_ast_node_t *
sdb_parser_parse_arith(int context,
const char *expr, int len, sdb_strbuf_t *errbuf);
/*
* sdb_parser_analyze:
* Semantical analysis of a parse-tree.
*
* Returns:
* - 0 on success
* - a negative value else; an error message will be written to the provided
* error buffer
*/
int
sdb_parser_analyze(sdb_ast_node_t *node, sdb_strbuf_t *errbuf);
/*
* sdb_parser_analyze_conditional:
* Semantical analysis of a conditional node in the specified context (any
* valid store object type).
*
* Returns:
* - 0 on success
* - a negative value else; an error message will be written to the provided
* error buffer
*/
int
sdb_parser_analyze_conditional(int context,
sdb_ast_node_t *node, sdb_strbuf_t *errbuf);
/*
* sdb_parser_analyze_arith:
* Semantical analysis of an arithmetic node in the specified context (any
* valid store object type).
*
* Returns:
* - 0 on success
* - a negative value else; an error message will be written to the provided
* error buffer
*/
int
sdb_parser_analyze_arith(int context,
sdb_ast_node_t *node, sdb_strbuf_t *errbuf);
/*
* Low-level interface.
*/
/* scanner/parser's YY_EXTRA data */
typedef struct {
/* list of sdb_ast_node_t objects */
sdb_llist_t *parsetree;
/* parser mode */
int mode;
/* buffer for parser error messages */
sdb_strbuf_t *errbuf;
} sdb_parser_yyextra_t;
/* see yyscan_t */
typedef void *sdb_parser_yyscan_t;
/*
* sdb_parser_scanner_init:
* Allocate and initialize a scanner object. It will operate on the specified
* string of the specified length. If len is less than zero, use the entire
* string. The scanner/parser extra data stores shared state information
* between the scanner and the parser.
*/
sdb_parser_yyscan_t
sdb_parser_scanner_init(const char *str, int len, sdb_parser_yyextra_t *yyext);
/*
* sdb_parser_scanner_destroy:
* Destroy a scanner object freeing all of its memory.
*/
void
sdb_parser_scanner_destroy(sdb_parser_yyscan_t scanner);
/*
* sdb_parser_yyparse:
* Invoke the low-level parser using the specified scanner. The result will be
* returned through the scanner/parser's extra data.
*
* Returns:
* - 0 on success
* - a non-zero value else; the error buffer stored in the scanner/parser's
* extra data provides an error message in this case
*/
int
sdb_parser_yyparse(sdb_parser_yyscan_t scanner);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* ! SDB_PARSER_PARSER_H */
/* vim: set tw=78 sw=4 ts=4 noexpandtab : */
| [
"sh@tokkee.org"
] | sh@tokkee.org |
74db0c55692c1db112d924fb1988fe59c1978087 | 421fea3ce763568f9cd90a34e7836a8b498f8cb9 | /src/images/enemies/momiji/Momiji_05.h | a2a9c8ac5a1fa00be01db6c2971d6c1da731784c | [
"BSD-3-Clause"
] | permissive | Press-Play-On-Tape/GalaxyFighter_Pokitto | f2173be272e50960aaefc8ec2ee47409c54f7a8a | ce135d529f3ed53a4f7ee27e0efe2dbd06a5b29b | refs/heads/master | 2022-06-26T11:32:40.615530 | 2020-01-27T23:02:47 | 2020-01-27T23:02:47 | 233,036,669 | 1 | 1 | BSD-3-Clause | 2020-01-22T09:19:47 | 2020-01-10T11:51:11 | C | UTF-8 | C | false | false | 883 | h | // Automatically generated file, do not edit.
#pragma once
const uint8_t Momiji_05[] = {
18, 17,
0x44,0x44,0x44,0x44,0x40,0x00,0x04,0x44,0x44,
0x44,0x44,0x44,0x44,0x40,0xee,0x00,0x04,0x44,
0x44,0x44,0x44,0x44,0x00,0x88,0xd7,0x04,0x44,
0x00,0x00,0x00,0x04,0x08,0x8c,0x76,0x04,0x44,
0x0e,0xee,0xee,0x00,0x08,0xd7,0x70,0x04,0x44,
0x00,0x88,0x88,0xe8,0x0d,0xc7,0x70,0x44,0x44,
0x40,0x08,0x88,0x88,0xdc,0x77,0x60,0x04,0x44,
0x44,0x00,0x08,0x88,0xc7,0x77,0x8e,0x00,0x04,
0x44,0x44,0x00,0x0d,0xc7,0x67,0x88,0x8e,0x00,
0x44,0x44,0x40,0xd6,0x88,0xe6,0x88,0x88,0xe0,
0x44,0x44,0x00,0xc8,0x88,0xe0,0x00,0x00,0x00,
0x40,0x00,0x0c,0x08,0x88,0xe0,0x44,0x44,0x44,
0x40,0xd0,0xc0,0x08,0x88,0xe0,0x44,0x44,0x44,
0x40,0x0c,0x00,0x08,0x88,0xe0,0x44,0x44,0x44,
0x00,0xd0,0xd0,0x08,0x8e,0x00,0x44,0x44,0x44,
0x0d,0x00,0x00,0x00,0x88,0x04,0x44,0x44,0x44,
0x00,0x04,0x44,0x40,0x00,0x04,0x44,0x44,0x44
};
| [
"simon@bloggingadeadhorse.com"
] | simon@bloggingadeadhorse.com |
e9d62269d470e27f3df180ef1d288395100f8265 | 976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f | /source/openpilot/phonelibs/nanovg/extr_stb_truetype.h_stbtt__fill_active_edges_new.c | 2d211a268f9f293e9a65940711abd8066b5679f7 | [] | no_license | isabella232/AnghaBench | 7ba90823cf8c0dd25a803d1688500eec91d1cf4e | 9a5f60cdc907a0475090eef45e5be43392c25132 | refs/heads/master | 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 7,889 | c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {float ey; float fdx; float fx; float fdy; float sy; int direction; struct TYPE_4__* next; } ;
typedef TYPE_1__ stbtt__active_edge ;
/* Variables and functions */
int /*<<< orphan*/ STBTT_assert (int) ;
float fabs (float) ;
int /*<<< orphan*/ stbtt__handle_clipped_edge (float*,int,TYPE_1__*,float,float,float,float) ;
__attribute__((used)) static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, stbtt__active_edge *e, float y_top)
{
float y_bottom = y_top+1;
while (e) {
// brute force every pixel
// compute intersection points with top & bottom
STBTT_assert(e->ey >= y_top);
if (e->fdx == 0) {
float x0 = e->fx;
if (x0 < len) {
if (x0 >= 0) {
stbtt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom);
stbtt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom);
} else {
stbtt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom);
}
}
} else {
float x0 = e->fx;
float dx = e->fdx;
float xb = x0 + dx;
float x_top, x_bottom;
float sy0,sy1;
float dy = e->fdy;
STBTT_assert(e->sy <= y_bottom && e->ey >= y_top);
// compute endpoints of line segment clipped to this scanline (if the
// line segment starts on this scanline. x0 is the intersection of the
// line with y_top, but that may be off the line segment.
if (e->sy > y_top) {
x_top = x0 + dx * (e->sy - y_top);
sy0 = e->sy;
} else {
x_top = x0;
sy0 = y_top;
}
if (e->ey < y_bottom) {
x_bottom = x0 + dx * (e->ey - y_top);
sy1 = e->ey;
} else {
x_bottom = xb;
sy1 = y_bottom;
}
if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len) {
// from here on, we don't have to range check x values
if ((int) x_top == (int) x_bottom) {
float height;
// simple case, only spans one pixel
int x = (int) x_top;
height = sy1 - sy0;
STBTT_assert(x >= 0 && x < len);
scanline[x] += e->direction * (1-((x_top - x) + (x_bottom-x))/2) * height;
scanline_fill[x] += e->direction * height; // everything right of this pixel is filled
} else {
int x,x1,x2;
float y_crossing, step, sign, area;
// covers 2+ pixels
if (x_top > x_bottom) {
// flip scanline vertically; signed area is the same
float t;
sy0 = y_bottom - (sy0 - y_top);
sy1 = y_bottom - (sy1 - y_top);
t = sy0, sy0 = sy1, sy1 = t;
t = x_bottom, x_bottom = x_top, x_top = t;
dx = -dx;
dy = -dy;
t = x0, x0 = xb, xb = t;
}
x1 = (int) x_top;
x2 = (int) x_bottom;
// compute intersection with y axis at x1+1
y_crossing = (x1+1 - x0) * dy + y_top;
sign = e->direction;
// area of the rectangle covered from y0..y_crossing
area = sign * (y_crossing-sy0);
// area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing)
scanline[x1] += area * (1-((x_top - x1)+(x1+1-x1))/2);
step = sign * dy;
for (x = x1+1; x < x2; ++x) {
scanline[x] += area + step/2;
area += step;
}
y_crossing += dy * (x2 - (x1+1));
STBTT_assert(fabs(area) <= 1.01f);
scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (sy1-y_crossing);
scanline_fill[x2] += sign * (sy1-sy0);
}
} else {
// if edge goes outside of box we're drawing, we require
// clipping logic. since this does not match the intended use
// of this library, we use a different, very slow brute
// force implementation
int x;
for (x=0; x < len; ++x) {
// cases:
//
// there can be up to two intersections with the pixel. any intersection
// with left or right edges can be handled by splitting into two (or three)
// regions. intersections with top & bottom do not necessitate case-wise logic.
//
// the old way of doing this found the intersections with the left & right edges,
// then used some simple logic to produce up to three segments in sorted order
// from top-to-bottom. however, this had a problem: if an x edge was epsilon
// across the x border, then the corresponding y position might not be distinct
// from the other y segment, and it might ignored as an empty segment. to avoid
// that, we need to explicitly produce segments based on x positions.
// rename variables to clear pairs
float y0 = y_top;
float x1 = (float) (x);
float x2 = (float) (x+1);
float x3 = xb;
float y3 = y_bottom;
float y1,y2;
// x = e->x + e->dx * (y-y_top)
// (y-y_top) = (x - e->x) / e->dx
// y = (x - e->x) / e->dx + y_top
y1 = (x - x0) / dx + y_top;
y2 = (x+1 - x0) / dx + y_top;
if (x0 < x1 && x3 > x2) { // three segments descending down-right
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x2,y2);
stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
} else if (x3 < x1 && x0 > x2) { // three segments descending down-left
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x1,y1);
stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
} else if (x0 < x1 && x3 > x1) { // two segments across x, down-right
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
} else if (x3 < x1 && x0 > x1) { // two segments across x, down-left
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
} else if (x0 < x2 && x3 > x2) { // two segments across x+1, down-right
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
} else if (x3 < x2 && x0 > x2) { // two segments across x+1, down-left
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
} else { // one segment
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x3,y3);
}
}
}
}
e = e->next;
}
} | [
"brenocfg@gmail.com"
] | brenocfg@gmail.com |
221fcf2d7fc63616b29215020f4fc3fef50ec1ae | 23ef4c886a350712a482767f85615bf9465dd4a9 | /team3_global.h | d8e3935e1d9957e0babad166f66e287385f78f37 | [] | no_license | herebiohazarhackathon/team3_sample | e01767afc1cea3bbe459f208fde1e6aa89c82e76 | 1074f5489cd7dfccf0c6e71c2b7fb41759bede3d | refs/heads/master | 2020-03-10T12:29:03.600519 | 2018-06-15T15:14:30 | 2018-06-15T15:14:30 | 129,379,929 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 228 | h | #ifndef TEAM3_GLOBAL_H
#define TEAM3_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(TEAM3_LIBRARY)
# define TEAM3SHARED_EXPORT Q_DECL_EXPORT
#else
# define TEAM3SHARED_EXPORT Q_DECL_IMPORT
#endif
#endif // TEAM3_GLOBAL_H
| [
"you@example.com"
] | you@example.com |
8e4c8e604cd558a89e0d6419c80d9b5e6416e949 | 7dfa3a5a873d4c0fc74d13e78f685daec543d621 | /src/libunixonacid/dd_open_read.c | f8b1b52f3e246f58ed958f262b4f0b697db5db09 | [] | no_license | djbtao/skalibs | 1c500ea0823c57dd6932b9aa80b54f2174a55064 | c2ed75c9838767af60a05451b6d216331c1dbccf | refs/heads/master | 2021-01-01T16:21:03.750988 | 2014-03-31T14:59:23 | 2014-03-31T14:59:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 279 | c | /* ISC license. */
#include "djbunix.h"
#include "unix-transactional.h"
int dd_open_read (dirdescriptor_t_ref dd, char const *path)
{
dirdescriptor_t d = DIRDESCRIPTOR_ZERO ;
d.fd = open_read(path) ;
if (d.fd < 0) return 0 ;
d.lnkfn = path ;
*dd = d ;
return 1 ;
}
| [
"k.os.tao@gmail.com"
] | k.os.tao@gmail.com |
ee93e90f460e67e19eb5b01c7a00d11a96bdc4c3 | a1446c3f95df2dfe097a9bd6b463767b00f18140 | /sys/arch/sparc64/include/pmap.h | 5be76a4ba47f3296bc0b6072fc1a8f673a04cd47 | [] | no_license | chrissicool/l4openbsd | e2fb756debc1c3bdc1c2da509fa228c25a3185e8 | 077177814444e08500e47bc2488502f11469bc60 | refs/heads/master | 2021-04-09T17:12:53.122136 | 2011-08-22T16:52:58 | 2011-08-22T16:52:58 | 1,706,491 | 18 | 4 | null | 2017-04-06T19:17:29 | 2011-05-05T14:08:03 | C | UTF-8 | C | false | false | 6,035 | h | /* $NetBSD: pmap.h,v 1.16 2001/04/22 23:19:30 thorpej Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
* Copyright (C) 1995, 1996 TooLs GmbH.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by TooLs GmbH.
* 4. The name of TooLs GmbH may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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 _MACHINE_PMAP_H_
#define _MACHINE_PMAP_H_
#ifndef _LOCORE
#include <machine/pte.h>
#include <sys/queue.h>
#endif
/*
* This scheme uses 2-level page tables.
*
* While we're still in 32-bit mode we do the following:
*
* offset: 13 bits
* 1st level: 1024 64-bit TTEs in an 8K page for 10 bits
* 2nd level: 512 32-bit pointers in the pmap for 9 bits
* -------
* total: 32 bits
*
* In 64-bit mode the Spitfire and Blackbird CPUs support only
* 44-bit virtual addresses. All addresses between
* 0x0000 07ff ffff ffff and 0xffff f800 0000 0000 are in the
* "VA hole" and trap, so we don't have to track them. However,
* we do need to keep them in mind during PT walking. If they
* ever change the size of the address "hole" we need to rework
* all the page table handling.
*
* offset: 13 bits
* 1st level: 1024 64-bit TTEs in an 8K page for 10 bits
* 2nd level: 1024 64-bit pointers in an 8K page for 10 bits
* 3rd level: 1024 64-bit pointers in the segmap for 10 bits
* -------
* total: 43 bits
*
* Of course, this means for 32-bit spaces we always have a (practically)
* wasted page for the segmap (only one entry used) and half a page wasted
* for the page directory. We still have need of one extra bit 8^(.
*/
#define HOLESHIFT (43)
#define PTSZ (NBPG/8)
#define PDSZ (PTSZ)
#define STSZ (PTSZ)
#define PTSHIFT (13)
#define PDSHIFT (10+PTSHIFT)
#define STSHIFT (10+PDSHIFT)
#define PTMASK (PTSZ-1)
#define PDMASK (PDSZ-1)
#define STMASK (STSZ-1)
#ifndef _LOCORE
/*
* Support for big page sizes. This maps the page size to the
* page bits.
*/
struct page_size_map {
u_int64_t mask;
u_int64_t code;
#ifdef DEBUG
u_int64_t use;
#endif
};
extern struct page_size_map page_size_map[];
/*
* Pmap stuff
*/
#define va_to_seg(v) (int)((((paddr_t)(v))>>STSHIFT)&STMASK)
#define va_to_dir(v) (int)((((paddr_t)(v))>>PDSHIFT)&PDMASK)
#define va_to_pte(v) (int)((((paddr_t)(v))>>PTSHIFT)&PTMASK)
#ifdef _KERNEL
struct pmap {
int pm_ctx; /* Current context */
int pm_refs; /* ref count */
/*
* This contains 64-bit pointers to pages that contain
* 1024 64-bit pointers to page tables. All addresses
* are physical.
*
* !!! Only touch this through pseg_get() and pseg_set() !!!
*/
paddr_t pm_physaddr; /* physical address of pm_segs */
int64_t *pm_segs;
struct simplelock pm_lock;
struct pmap_statistics pm_stats;
};
/*
* This comes from the PROM and is used to map prom entries.
*/
struct prom_map {
u_int64_t vstart;
u_int64_t vsize;
u_int64_t tte;
};
#define PMAP_NC 0x001 /* Set the E bit in the page */
#define PMAP_NVC 0x002 /* Don't enable the virtual cache */
#define PMAP_LITTLE 0x004 /* Map in little endian mode */
/* Large page size hints -- we really should use another param to pmap_enter() */
#define PMAP_8K 0x000
#define PMAP_64K 0x008 /* Use 64K page */
#define PMAP_512K 0x010
#define PMAP_4M 0x018
#define PMAP_SZ_TO_TTE(x) (((x)&0x018)<<58)
/* If these bits are different in va's to the same PA then there is an aliasing in the d$ */
#define VA_ALIAS_MASK (1<<13)
typedef struct pmap *pmap_t;
/*
* Encode IO space for pmap_enter()
*
* Since sun4u machines don't have separate IO spaces, this is a noop.
*/
#define PMAP_IOENC(io) 0
extern struct pmap kernel_pmap_;
#define pmap_kernel() (&kernel_pmap_)
/* int pmap_change_wiring(pmap_t pm, vaddr_t va, boolean_t wired); */
#define pmap_resident_count(pm) ((pm)->pm_stats.resident_count)
#define pmap_update(pm) /* nothing (yet) */
#define pmap_proc_iflush(p,va,len) /* nothing */
void pmap_bootstrap(u_long, u_long, u_int, u_int);
/* make sure all page mappings are modulo 16K to prevent d$ aliasing */
#define PMAP_PREFER(pa, va) ((va) + (((va) ^ (pa)) & VA_ALIAS_MASK))
#define PMAP_GROWKERNEL /* turn on pmap_growkernel interface */
/* SPARC specific? */
void pmap_redzone(void);
int pmap_dumpsize(void);
int pmap_dumpmmu(int (*)(dev_t, daddr64_t, caddr_t, size_t), daddr64_t);
int pmap_pa_exists(paddr_t);
struct proc;
void switchexit(struct proc *);
/* SPARC64 specific */
int ctx_alloc(struct pmap*);
void ctx_free(struct pmap*);
#endif /* _KERNEL */
#endif /* _LOCORE */
#endif /* _MACHINE_PMAP_H_ */
| [
"cludwig@net.t-labs.tu-berlin.de"
] | cludwig@net.t-labs.tu-berlin.de |
4184b8ac2a76df63eb43199ffc86a57b73fff459 | b970afcae0ca55dc8b9fc0c2fe8776fa196c4f89 | /src/aar.c | 54067c07df7ba5d9c3da469f22ac6a2bd4d27fff | [
"MIT"
] | permissive | JaapSuter/parg | 22611bc92e9ba33b6802bb959dd00b1c02a7e241 | 877fe79a19079d6764d4010e732ff3dda91a8adf | refs/heads/master | 2020-05-29T11:51:59.502984 | 2016-01-16T23:32:35 | 2016-01-16T23:32:35 | 45,494,813 | 0 | 0 | null | 2015-11-03T20:53:11 | 2015-11-03T20:53:11 | null | UTF-8 | C | false | false | 2,350 | c | #include <parg.h>
#include <math.h>
float parg_aar_to_tilerange(parg_aar rect, Vector2 size, parg_tilerange* range)
{
float e = PARG_MAX(size.x, size.y);
Vector2 mapsquare = {e, e};
Vector2 mapmin = {e * -.5, e * -.5};
parg_aar sqrrect = parg_aar_stretch_to_square(rect);
float mag = size.y / parg_aar_height(sqrrect);
float z = log(mag) / log(2.0f);
parg_tilename tilename = {0, 0, z};
mag = 1 << (int) z;
float tilesize = mapsquare.x / mag;
range->mintile = tilename;
range->maxtile = tilename;
range->mintile.x = (rect.left - mapmin.x) / tilesize;
range->mintile.y = (rect.bottom - mapmin.y) / tilesize;
range->maxtile.x = (rect.right - mapmin.x) / tilesize;
range->maxtile.y = (rect.top - mapmin.y) / tilesize;
return fmodf(z, 1.0);
}
parg_aar parg_aar_from_tilename(parg_tilename tile, Vector2 mapsize)
{
float e = PARG_MAX(mapsize.x, mapsize.y);
Vector2 mapsquare = {e, e};
Vector2 mapmin = {e * -.5, e * -.5};
float mag = 1 << (int) tile.z;
float tilesize = mapsquare.x / mag;
parg_aar rect;
rect.left = mapmin.x + tilesize * tile.x;
rect.bottom = mapmin.y + tilesize * tile.y;
rect.right = mapmin.x + tilesize * (tile.x + 1);
rect.top = mapmin.y + tilesize * (tile.y + 1);
return rect;
}
parg_aar parg_aar_from_tilerange(parg_tilerange range, Vector2 mapsize)
{
parg_aar a = parg_aar_from_tilename(range.mintile, mapsize);
parg_aar b = parg_aar_from_tilename(range.maxtile, mapsize);
return parg_aar_encompass(a, b);
}
parg_aar parg_aar_encompass(parg_aar a, parg_aar b)
{
a.left = PARG_MIN(a.left, b.left);
a.bottom = PARG_MIN(a.bottom, b.bottom);
a.right = PARG_MAX(a.right, b.right);
a.top = PARG_MAX(a.top, b.top);
return a;
}
parg_aar parg_aar_stretch_to_square(parg_aar rect)
{
float x = 0.5 * (rect.right + rect.left);
float y = 0.5 * (rect.top + rect.bottom);
float w = parg_aar_width(rect);
float h = parg_aar_height(rect);
if (w > h) {
h = w / 2;
rect.bottom = y - h;
rect.top = y + h;
} else {
w = h / 2;
rect.left = x - w;
rect.right = x + w;
}
return rect;
}
float parg_aar_height(parg_aar rect) { return rect.top - rect.bottom; }
float parg_aar_width(parg_aar rect) { return rect.right - rect.left; }
| [
"philiprideout@gmail.com"
] | philiprideout@gmail.com |
bdfb64bfc9b7bbfd46cb0b2161c8d0da6c82ac25 | 8eae1db9cb311fd24ff4c5afa906d5168ef550d9 | /euler25.c | 673d0c9768347c2f5e4a9e99499de2fda288f5ed | [] | no_license | gaoyuY/euler | 3b20ce8c9d9ba4245a13815ecd180c77bdf358be | e95e1bf8af1a1af5092759f5d7a20cdebeeeac23 | refs/heads/master | 2020-03-25T08:14:16.728548 | 2018-09-02T02:58:07 | 2018-09-02T02:58:07 | 143,603,649 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 819 | c | /*************************************************************************
> File Name: euler25.c
> Author:
> Mail:
> Created Time: 2018年07月27日 星期五 10时08分33秒
************************************************************************/
#include<stdio.h>
int main () {
int fib[3][1005] = {{0, 0}, {1, 1}, {1, 1}};
int n = 2;
while(fib[n % 3][0] < 1000) {
n+=1;
int *a = fib[n % 3], *b = fib[(n - 1) % 3], *c = fib[(n -2) % 3];
a[0] = b[0];
for (int j = 1; j <= b[0]; j++) {
a[j] = b[j] + c[j];
}
for (int j = 1; j <= a[0]; j++) {
if (a[j] < 10) continue;
a[j + 1] += a[j] / 10;
a[j] %= 10;
a[0] += (j == a[0]);
}
}
printf("%d\n", n);
return 0;
}
| [
"2282940822@qq.com"
] | 2282940822@qq.com |
bfd0d7009bfa78a106fe5413e6b40485ba201a7d | 1c73679a2672eaacdc0b67a2574b57871f1577e1 | /libft/integer/ft_itoa.c | 464c60031028bd7b5ccd8653297a6ba027a1c9e2 | [] | no_license | jlsrvr/cub3d | d45918f602e3bdff3fccb00988bb419a5871aaa7 | dacb0dfc5adedffd953ba1a9f8e0445b36d1c99c | refs/heads/master | 2023-05-09T10:27:42.222729 | 2021-06-02T15:04:26 | 2021-06-02T15:06:10 | 354,927,248 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,653 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_itoa.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jrivoire <jrivoire@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/27 11:27:16 by jrivoire #+# #+# */
/* Updated: 2021/04/01 11:39:30 by jrivoire ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
static int len_num(int n)
{
size_t len;
unsigned int nbr;
len = 0;
if (n == 0)
return (1);
if (n < 0)
{
len++;
nbr = -n;
}
else
nbr = n;
while (nbr > 9)
{
len++;
nbr = nbr / 10;
}
return (len + 1);
}
static void store_num(unsigned int nbr, char *num, size_t *index)
{
if (nbr < 10)
num[(*index)++] = (nbr + 48);
else
{
store_num((nbr / 10), num, index);
store_num((nbr % 10), num, index);
}
num[*index] = 0;
return ;
}
char *ft_itoa(int n)
{
char *num;
size_t index;
unsigned int nbr;
num = malloc(sizeof(*num) * (len_num(n) + 1));
if (!num)
return (NULL);
index = 0;
if (n < 0)
{
num[index++] = '-';
nbr = -n;
}
else
nbr = n;
store_num(nbr, num, &index);
return (num);
}
| [
"julesriv@gmail.com"
] | julesriv@gmail.com |
c0409b931fed13c3f0626e603bedb58682bc72b2 | 0a8c4d1c3a84d8a40be6661c1d99270954129d39 | /lab5-181860044/.history/lab5/app/main_20200607071520.c | 876c9fef0bdf17cf461577b8c8cf557b1531e2ad | [] | no_license | shijiajie30/NJU_OSlab | f5056b60801d4935dc7135474a3f9a7b15ef2672 | 5776c37082413f5271f343d2d3b7b9d058e9565a | refs/heads/master | 2022-10-09T14:42:52.178137 | 2020-06-08T12:55:56 | 2020-06-08T12:55:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 726 | c | #include "types.h"
#include "lib.h"
int uEntry(void) {
int fd = 0;
int i = 0;
char tmp = 0;
//ls("/");
//ls("/boot/");
//ls("/dev/");
//ls("/usr/");
printf("create /usr/test and write alphabets to it\n");
fd = open("/usr/test", O_READ | O_WRITE | O_CREATE);
for (i = 0; i < 512; i ++) {
tmp = (char)(i % 26 + 'A');
write(fd, (uint8_t*)&tmp, 1);
//printf("%c",tmp);
}
/*printf("\nread:");
for (i = 0; i < 512; i ++) {
read(fd, (uint8_t*)&tmp, 1);
printf("%c",tmp);
} */
close(fd);
fd = open("/usr/test", O_READ | O_WRITE);
printf("\nread %d:",fd);
for (i = 0; i < 26; i ++) {
read(fd, (uint8_t*)&tmp, 1);
printf("%c",tmp);
}
//ls("/usr/");
//cat("/usr/test");
exit();
return 0;
} | [
"181860044@smail.nju.edu.cn"
] | 181860044@smail.nju.edu.cn |
809ae55918ce282a4cf9eecf4f5da486044364e7 | dcf26a6bcf853a3f8f6f50f9379998ef4d8aad40 | /test/xts/acts/utils_lite/parameter_hal/src/parameter_reli_test.c | cd16a606249b0fb6a31249750afd143ab12d02d7 | [] | no_license | small-seven/testmem | c5f3202dce1c369e9d84cdaaccc2008b827c16d8 | 2771460c617439bd1be562ffdc94543ea170a736 | refs/heads/main | 2023-03-12T22:16:28.824577 | 2021-03-03T04:24:59 | 2021-03-03T04:24:59 | 343,847,762 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 142 | c | #include "hos_types.h"
#include <securec.h>
#include "hctest.h"
#include "parameter.h"
#include "parameter_utils.h"
#define QUERY_TIMES 50
| [
"huihuigong@users.noreply.github.com"
] | huihuigong@users.noreply.github.com |
e2a6e96e052b306dbd9f5e80a458fca8120cc66b | 8d753bb8f19b5b1f526b0688d3cb199b396ed843 | /osp_sai_2.1.8/system/proto/lib/include/proto_module.h | da9507a1810976ece91f9f0c1189a5579b5a0b7c | [] | no_license | bonald/vim_cfg | f166e5ff650db9fa40b564d05dc5103552184db8 | 2fee6115caec25fd040188dda0cb922bfca1a55f | refs/heads/master | 2023-01-23T05:33:00.416311 | 2020-11-19T02:09:18 | 2020-11-19T02:09:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,351 | h |
#ifndef __PROTO_MODULE_H__
#define __PROTO_MODULE_H__
typedef enum pm_id_e
{
PM_ID_INVALID = 0,
PM_ID_CTL = 1,
PM_ID_CCS = 2,
PM_ID_CDS = 3,
PM_ID_CHSM = 4,
PM_ID_SWITCH = 5,
PM_ID_ROUTED = 6,
PM_ID_OPM = 7,
PM_ID_AUTHD = 8,
PM_ID_APPCFG = 9,
PM_ID_FEA = 10,
PM_ID_OPENFLOW = 11,
PM_ID_DHCRELAY = 12,
PM_ID_DHCSNOOPING = 13,
PM_ID_DHCLIENT = 14,
PM_ID_PTP = 15,
PM_ID_BHM = 16,
PM_ID_EVENTMGR = 17,
PM_ID_SSM = 18,
PM_ID_SUBSCRIBER = 19,
PM_ID_NCS = 20,
PM_ID_DHCPD6 = 21,
PM_ID_DHCLIENT6 = 22,
PM_ID_MAX = 23
} pm_id_t;
typedef enum pm_id_ext_e
{
PM_ID_EXT_BASE = PM_ID_MAX,
PM_ID_EXT_ZEBRA = PM_ID_EXT_BASE + 4,
PM_ID_EXT_OSPFD = PM_ID_EXT_BASE + 5,
PM_ID_EXT_BGPD = PM_ID_EXT_BASE + 6,
PM_ID_EXT_PIMD = PM_ID_EXT_BASE + 7,
PM_ID_EXT_OVSDB = PM_ID_EXT_BASE + 8,
PM_ID_EXT_MAX = PM_ID_EXT_BASE + 9
} pm_id_ext_t;
const char*
proto_module_desc(pm_id_t pm_id);
const char*
proto_module_name_desc(pm_id_t pm_id);
const char*
proto_module_ext_name_desc(pm_id_ext_t pm_id);
#endif /* !__PROTO_MODULE_H__ */
| [
"zhwwan@gmail.com"
] | zhwwan@gmail.com |
55e8036da9579d0b24e0d239bea800f63f4cf178 | e3008f57def40e85ab8cd7b947a8001557290e51 | /d/dagger/nurval/room/fountain.c | a2dbec962608e81c3af0f80f691614b6a19c80e0 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | nm0i/shadowgate | 3be0aa4817b238fb81b9abf6dc051b1ddeb09a8f | e5d4b8ed2b4e1bac397fcb14a398851e28eb4803 | refs/heads/master | 2022-11-21T23:19:40.689065 | 2020-07-18T04:41:17 | 2020-07-18T04:41:17 | 269,268,452 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,765 | c | #include "../tomb.h"
inherit TOMBSTR;
void create(){
::create();
set_name("Necropolis");
set_short("%^BOLD%^%^BLUE%^Fountain of Souls, %^WHITE%^Tomb of Nurval%^RESET%^");
set_long(
"%^BOLD%^%^BLUE%^Fountain of Souls, %^CYAN%^The ground level of %^WHITE%^Tomb of Nurval%^RESET%^
%^BOLD%^%^WHITE%^The tunnels converge here in a large hollow chamber made of pearl-white marble. In the center of it, from the round hole in the floor, raises into a similar hole in the ceiling a fountain of %^CYAN%^sky blue%^WHITE%^ light. Numerous undead gather around it, most stand prostrating themselves in a trance, looking at the light. Occasionally someone steps into the light and floats up or down, or someone floats up from below or down from above. The light is harmless to the undead traviling it, and the traffic between layers of the pyramid is busy here.
");
set_exits(([
"north":ROOMS+"/tomb2",
"west":ROOMS+"/tomb1",
"south":ROOMS+"/tomb4",
"east":ROOMS+"/tomb3",
"up":ROOMS+"/fountain2",
]));
set_pre_exit_functions(({"up"}),({"soulwell_trav"}));
set_heart_beat(0);
}
int soulwell_trav()
{
tell_room(TO,"%^CYAN%^The light envelops "+TP->QCN+".%^RESET%^",TP);
tell_object(TP,"%^CYAN%^The light envelops you.%^RESET%^");
if(TP->is_undead())
TP->cause_typed_damage(TP,TP->return_target_limb(),TP->query_max_hp()/3,"negative energy");
return 1;
}
void reset()
{
::reset();
if (!present("guard"))
new(MONS + "/necroknight")->move(TO);
if (!present("guard 2"))
new(MONS + "/necroknight")->move(TO);
if (!present("guard 3"))
new(MONS + "/necroknight")->move(TO);
}
| [
"law@shadowgate.org"
] | law@shadowgate.org |
9de936a4061ab9dea208fd57121db3607206872c | b1996750cc84e41589383e8058bb014b8f7786e6 | /examples/EFM8UB3_SLTB005A/Bootloader/UART/src/boot_UART0.c | e5dc88f8d63bf5d1b3c17eb37eb20baaca248a5d | [] | no_license | mathiasvr/silabs-8051-sdk | 9f66e905bb31aa5c4efcaf4055b17380b330a016 | eff6046fcb1705f00588bcd2d03cc8f0361bfc14 | refs/heads/main | 2022-07-30T06:20:11.791382 | 2022-01-05T00:29:38 | 2022-01-05T01:22:03 | 444,606,667 | 2 | 3 | null | null | null | null | UTF-8 | C | false | false | 3,475 | c | /******************************************************************************
* Copyright (c) 2015 by Silicon Laboratories Inc. All rights reserved.
*
* http://developer.silabs.com/legal/version/v11/Silicon_Labs_Software_License_Agreement.txt
*****************************************************************************/
#include "efm8_device.h"
#include "boot.h"
// If the device does not have XRAM, use IDATA to hold a small receive buffer;
// otherwise, use XRAM to hold a full-size receive buffer.
#if (DEVICE_XRAM_SIZE < 256)
// Sized to hold the payload for 128 byte write command.
// Erase/Write = 1 byte command + 2 bytes address + 128 bytes data
#define BOOT_RXBUF_SIZE 132
// Buffer holds data received from the host
uint8_t SI_SEG_IDATA boot_rxBuf[BOOT_RXBUF_SIZE];
// Used to cloak buffer access
#define BOOT_RXBUF(i) boot_rxBuf[i]
#else
// Sized to hold the maximum boot record payload
#define BOOT_RXBUF_SIZE 256
// Buffer holds data received from the host (must be located at 0)
uint8_t SI_SEG_XDATA boot_rxBuf[BOOT_RXBUF_SIZE] _at_ 0x00;
// Cloaks XDATA buffer access to reduce code size.
// CAUTION: For this to work properly, the buffer must be located at address 0x0.
#define BOOT_RXBUF(i) *((uint8_t SI_SEG_XDATA *)(i))
#endif // DEVICE_XRAM_SIZE
// Counts the number of bytes remaining in the receive buffer. Also acts as
// the index for the next byte to get from the receive buffer.
uint8_t boot_rxNext;
// ----------------------------------------------------------------------------
// Read one byte from UART0.
// ----------------------------------------------------------------------------
static uint8_t readByte(void)
{
// Wait indefinitely for a byte to arrive
while (!SCON1_RI)
;
SCON1_RI = 0;
return SBUF1;
}
// ----------------------------------------------------------------------------
// Wait for the next boot record to arrive.
// ----------------------------------------------------------------------------
void boot_nextRecord(void)
{
uint8_t count;
// Wait indefinitely to receive a frame start character
while (BOOT_FRAME_START != readByte())
;
// Receive and save the frame length
count = readByte();
boot_rxNext = count;
// Receive and buffer frame data. Data is stored in reverse order (from
// the end of the buffer to the beginning) to save code space.
for (; count; count--)
{
BOOT_RXBUF(count) = readByte();
}
}
// ----------------------------------------------------------------------------
// Get the next byte in the boot record.
// ----------------------------------------------------------------------------
uint8_t boot_getByte(void)
{
uint8_t next = BOOT_RXBUF(boot_rxNext);
boot_rxNext--;
return next;
}
// ----------------------------------------------------------------------------
// Get the next word in the boot record.
// ----------------------------------------------------------------------------
uint16_t boot_getWord(void)
{
SI_UU16_t word;
// 16-bit words are received in big-endian order
word.u8[0] = boot_getByte();
word.u8[1] = boot_getByte();
return word.u16;
}
// ----------------------------------------------------------------------------
// Send a one byte reply to the host.
// ----------------------------------------------------------------------------
void boot_sendReply(uint8_t reply)
{
SCON1_TI = 0;
SBUF1 = reply;
// Wait for the byte to be transmitted before returning
while (!SCON1_TI)
;
}
| [
"mathiasvr@gmail.com"
] | mathiasvr@gmail.com |
f8ae319f3e16d68e658d38c885ec0ea3abe73efb | 7ccf47b8d3dca1154bf190a5b498440751bac0d0 | /DayZExpansion/Scripts/4_World/DayZExpansion/Entities/Basebuilding/Misc/Deployable/ExpansionBarrierGate.c | 3c4d4e39d9361798159afbef8a57f82d306dccc7 | [] | no_license | Zysen/DayZ-Expansion-Scripts | 44afd81dce14e765e1e74b9f4e49a4623cd5b7a2 | befd7e7cfee6a85f4cc1b26326e5d6c6a4b11ed7 | refs/heads/master | 2022-11-17T18:11:20.498671 | 2020-06-24T07:21:37 | 2020-06-24T07:21:37 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,027 | c | /**
* ExpansionBarrierGate.c
*
* DayZ Expansion Mod
* www.dayzexpansion.com
* © 2020 DayZ Expansion Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*
*/
/**@class ExpansionBarrierGate
* @brief
**/
class ExpansionBarrierGate: ExpansionBaseBuilding
{
protected bool m_IsOpened;
// ------------------------------------------------------------
// Constructor
// ------------------------------------------------------------
void ExpansionBarrierGate()
{
}
// ------------------------------------------------------------
// Destructor
// ------------------------------------------------------------
void ~ExpansionBarrierGate()
{
}
// ------------------------------------------------------------
// CanPutInCargo
// ------------------------------------------------------------
override bool CanPutInCargo (EntityAI parent)
{
return false;
}
// ------------------------------------------------------------
// IsInventoryVisible
// ------------------------------------------------------------
override bool IsInventoryVisible()
{
return true;
}
// ------------------------------------------------------------
// GetConstructionKitType
// ------------------------------------------------------------
override string GetConstructionKitType()
{
return "ExpansionBarrierGateKit";
}
// ------------------------------------------------------------
// SetActions
// ------------------------------------------------------------
override void SetActions()
{
super.SetActions();
AddAction(ActionFoldBaseBuildingObject);
//! AddAction(ExpansionActionOpen);
//! AddAction(ExpansionActionClose);
}
// ------------------------------------------------------------
// Expansion CanOpen
// ------------------------------------------------------------
override bool CanOpen( PlayerBase player, string selection )
{
if (selection == "gate" && GetAnimationPhase("gate") == 1)
return true;
return false;
}
// ------------------------------------------------------------
// Expansion CanClose
// ------------------------------------------------------------
override bool CanClose( string selection )
{
if (selection == "gate" && GetAnimationPhase("gate") == 0)
return true;
return false;
}
// ------------------------------------------------------------
// Expansion Open
// ------------------------------------------------------------
override void Open( string selection )
{
//! Door open animation
if (selection == "gate")
SetAnimationPhase( "gate", 0 );
m_IsOpened = true;
SetSynchDirty();
super.Open( selection );
}
// ------------------------------------------------------------
// Expansion Close
// ------------------------------------------------------------
override void Close( string selection )
{
//! Door open animation
if (selection == "gate")
SetAnimationPhase( "gate", 1 );
m_IsOpened = false;
SetSynchDirty();
super.Close( selection );
}
override void OnStoreSave(ParamsWriteContext ctx)
{
super.OnStoreSave( ctx );
ctx.Write( m_IsOpened );
}
override bool OnStoreLoad( ParamsReadContext ctx, int version )
{
if ( !super.OnStoreLoad( ctx, version ) )
{
return false;
}
if ( !ctx.Read( m_IsOpened ) )
{
return false;
}
if ( m_IsOpened )
{
SetAnimationPhase( "gate", 0 );
}
else
{
SetAnimationPhase( "gate", 1 );
}
return true;
}
// ------------------------------------------------------------
// CanBeDamaged
// ------------------------------------------------------------
override bool CanBeDamaged()
{
return false;
}
// ------------------------------------------------------------
// AfterStoreLoad
// ------------------------------------------------------------
override void AfterStoreLoad()
{
}
} | [
"GThurston00@gmail.com"
] | GThurston00@gmail.com |
1a6b39013c52d5f223743a6f470eefdca51d04aa | f9b5883f506b3a66ec52b5813e1114b38011ae5b | /alder-palign/alder-palign/alder_palign_option.h | 33d7647fbdc583347415c3ac52c011bb112f7c54 | [] | no_license | goshng/cocoa | 53991c024793adf96dd6bc81ac1428fd010308af | a9a0752ccffbefb0963836e5923960c39accbc4b | refs/heads/master | 2020-04-06T04:38:42.012354 | 2014-09-24T23:35:28 | 2014-09-24T23:35:28 | 8,891,311 | 1 | 2 | null | null | null | null | UTF-8 | C | false | false | 1,360 | h | /**
* This file, alder_palign_option.h, is part of alder-palign.
*
* Copyright 2013 by Sang Chul Choi
*
* alder-palign 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.
*
* alder-palign 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 alder-palign. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef alder_palign_alder_palign_option_h
#define alder_palign_alder_palign_option_h
#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
#endif
__BEGIN_DECLS
typedef struct {
struct bstrList *infile;
struct bstrList *outfile;
bstring logfilename;
} alder_palign_t;
int alder_palign_init(alder_palign_t *o, struct gengetopt_args_info *a);
void alder_palign_free(alder_palign_t *o);
__END_DECLS
#endif /* alder_palign_alder_palign_option_h */
| [
"goshng@yahoo.co.kr"
] | goshng@yahoo.co.kr |
deaa634186e356b3f9288961ad44b341b1c647df | 976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f | /source/linux/arch/x86/kernel/apic/extr_apic.c_lapic_timer_set_periodic.c | 0c007d54a6d21dfa8e2745d8874193962f9829db | [] | no_license | isabella232/AnghaBench | 7ba90823cf8c0dd25a803d1688500eec91d1cf4e | 9a5f60cdc907a0475090eef45e5be43392c25132 | refs/heads/master | 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 654 | c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct clock_event_device {int dummy; } ;
/* Variables and functions */
int lapic_timer_set_periodic_oneshot (struct clock_event_device*,int) ;
__attribute__((used)) static int lapic_timer_set_periodic(struct clock_event_device *evt)
{
return lapic_timer_set_periodic_oneshot(evt, false);
} | [
"brenocfg@gmail.com"
] | brenocfg@gmail.com |
84215980329c5ea0272b46f11eccdc5296460337 | 76f7ea1104667491cd568a2d87ddb7ce45b8a543 | /Temp/StagingArea/Data/il2cppOutput/t3835141271MD.h | b108d80560339f1ae5b53ad11d012b6ba5b080c5 | [] | no_license | Crazydriver8/Ghosts | d9273752d8fadbc9c3a2fce23c9b0b432e12a92c | 5f2f8903e5c5fa58d433ca6796129b99277df5d1 | refs/heads/master | 2021-01-10T18:19:55.938507 | 2016-02-17T05:01:43 | 2016-02-17T05:01:43 | 51,810,611 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,466 | h | #pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include <assert.h>
#include <exception>
struct t3835141271;
struct t707969140;
#include "codegen/il2cpp-codegen.h"
#include "t707969140.h"
extern "C" void m1952047100_gshared (t3835141271 * __this, const MethodInfo* method);
#define m1952047100(__this, method) (( void (*) (t3835141271 *, const MethodInfo*))m1952047100_gshared)(__this, method)
extern "C" void m1863390761_gshared (t707969140 * __this , const MethodInfo* method);
#define m1863390761(__this , method) (( void (*) (t707969140 * , const MethodInfo*))m1863390761_gshared)(__this , method)
extern "C" int32_t m3901093757_gshared (t3835141271 * __this, t707969140 * p0, const MethodInfo* method);
#define m3901093757(__this, p0, method) (( int32_t (*) (t3835141271 *, t707969140 *, const MethodInfo*))m3901093757_gshared)(__this, p0, method)
extern "C" bool m3134072983_gshared (t3835141271 * __this, t707969140 * p0, t707969140 * p1, const MethodInfo* method);
#define m3134072983(__this, p0, p1, method) (( bool (*) (t3835141271 *, t707969140 *, t707969140 *, const MethodInfo*))m3134072983_gshared)(__this, p0, p1, method)
extern "C" t3835141271 * m3911577264_gshared (t707969140 * __this , const MethodInfo* method);
#define m3911577264(__this , method) (( t3835141271 * (*) (t707969140 * , const MethodInfo*))m3911577264_gshared)(__this , method)
| [
"krazydriver8@gmail.com"
] | krazydriver8@gmail.com |
5fbcbc2be649e4a10914a2f953dc926b2ea5e1b5 | e7aa1db6b25b91220ecb950b22b8032f7644bd65 | /include/ananas/amd64/_stdint.h | a5e55fe8efcc8361fdf8f954b9898d4a1795cb8b | [
"Beerware",
"LicenseRef-scancode-public-domain"
] | permissive | Horaddrim/ananas | b6fe5dfac561450f615f0da5a3e1703d8eec77ed | ccf3d4ea9496e80fc7b6207b32a86bc569d835f4 | refs/heads/master | 2021-01-15T19:06:44.527184 | 2017-07-30T11:29:48 | 2017-07-30T11:29:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,507 | h | #ifndef __I386_STDINT_H__
#define __I386_STDINT_H__
/* 7.18.2.1: Limits of exact-width integer types */
#define INT8_MIN (-128)
#define INT16_MIN (-32768)
#define INT32_MIN (-2147483648)
#define INT64_MIN ((-9223372036854775807LL) - 1)
#define INT8_MAX (127)
#define INT16_MAX (32767)
#define INT32_MAX (2147483647)
#define INT64_MAX (9223372036854775807LL)
#define UINT8_MAX (255)
#define UINT16_MAX (65535)
#define UINT32_MAX (4294967295U)
#define UINT64_MAX (18446744073709551615ULL)
/* 7.18.2.2: Limits of minimum-width integer types */
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
/* 7.18.2.3: Limits of fastest minimum-width integer types */
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
/* 7.18.2.4: Limits of integer types capable of holding object pointers */
#define INTPTR_MIN INT64_MIN
#define INTPTR_MAX INT64_MAX
#define UINTPTR_MAX UINT64_MAX
/* 7.18.2.5: Limits of greatest-width integer types */
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
/* 7.18.3: Limits of other integer types */
#define PTRDIFF_MIN INT64_MIN
#define PTRDIFF_MAX INT64_MAX
#define SIZE_MAX UINT64_MAX
#define SIG_ATOMIC_MIN INT32_MIN
#define SIG_ATOMIC_MAX INT32_MAX
#define WCHAR_MIN INT32_MIN /* XXX assume wchar = 32 bit */
#define WCHAR_MAX INT32_MAX
#define WINT_MIN INT32_MIN /* XXX assume wint = 32 bit */
#define WINT_MAX INT32_MAX
/* 7.18.4: Macros for integer constants */
#define INT8_C(c) (c)
#define INT16_C(c) (c)
#define INT32_C(c) (c)
#define INT64_C(c) (c ## LL)
#define UINT8_C(c) (c)
#define UINT16_C(c) (c)
#define UINT32_C(c) (c ## U)
#define UINT64_C(c) (c ## ULL)
#define INTMAX_C(c) (c ## LL)
#define UINTMAX_C(c) (c ## ULL)
#endif /* __I386_STDINT_H__ */
| [
"rink@rink.nu"
] | rink@rink.nu |
710a0325e11fd7c11b5f1cfc2b6ea800da1f5723 | 31976d7f26c6449cd52b470f2eefc7a924eaf115 | /soft/platform/service/net/mupnp/src/mupnp/include/mupnp/typedef.h | 99d911029b6318a76201c720a265fe8142d58668 | [] | no_license | jhart99/RDA8955_W17.44_IDH | 1198a5b7eafcdeb2403676beb697887d8b9d6036 | 09ecb99b552f498388d53386befb7f75b03da2a7 | refs/heads/master | 2023-04-23T16:41:25.513792 | 2021-05-10T07:14:01 | 2021-05-10T07:14:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,427 | h | /******************************************************************
*
* mUPnP for C
*
* Copyright (C) Satoshi Konno 2005
* Copyright (C) 2006 Nokia Corporation. All rights reserved.
*
* This is licensed under BSD-style license, see file COPYING.
*
******************************************************************/
#ifndef _MUPNP_TYPEDEF_H_
#define _MUPNP_TYPEDEF_H_
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#if defined(WINCE) && !defined(WIN32)
#define WIN32 1
#endif
#if (defined(WIN32) || defined(__CYGWIN__)) && !defined(ITRON)
#include <winsock2.h>
#include <ws2tcpip.h>
#elif defined(BTRON) || defined(TENGINE)
#include <typedef.h>
#elif defined(ITRON)
#include <kernel.h>
#endif
#if defined(__APPLE_CPP__) || defined(__APPLE_CC__)
#include <TargetConditionals.h>
#endif
//#ifdef HAVE_CONFIG_H
#include "config.h"
//#endif
#ifdef __cplusplus
extern "C" {
#endif
/****************************************
* Compiler
****************************************/
#if __STDC_VERSION__ >= 199901L
#define C99
#endif
/****************************************
* Data Type
****************************************/
#if defined(C99) || defined(HAVE_STDBOOL_H)
#include <stdbool.h>
#else
#if !defined(bool)
#define bool int
#endif
#if !defined(true)
#define true 1
#endif
#if !defined(false)
#define false 0
#endif
#endif
typedef unsigned char mUpnpByte;
#ifdef __cplusplus
}
#endif
#endif
| [
"1036421284@qq.com"
] | 1036421284@qq.com |
c09597a3b4e4e2cfd099592879b5ccdeb1fa9ce3 | ffd20da031e8634e31fa89cda6d9ea06e2234c03 | /CPool_bistro-matic_2018/lib/my/my_strdup.c | 263991e2625d5b5defa870f8f6520298ffbc6fdf | [] | no_license | ThomasScol/CPool | ed6efd606c43f5e2f6e1d9f8bb402eb9b0c1926a | 987c4abb2e247046aa2ac664297b0939795c71aa | refs/heads/master | 2023-03-19T00:31:42.520341 | 2019-06-02T14:33:37 | 2019-06-02T14:33:37 | 535,631,786 | 1 | 0 | null | 2022-09-12T11:18:00 | 2022-09-12T11:17:59 | null | UTF-8 | C | false | false | 368 | c | /*
** EPITECH PROJECT, 2018
** my_strdup
** File description:
** my_strdup
*/
#include "../../include/my.h"
#include <stdlib.h>
char *my_strdup(char const *src)
{
char *dest;
int i = 0;
dest = malloc(sizeof(char) * (my_strlen(src) + 1));
while (src[i] != '\0') {
dest[i] = src[i];
i++;
}
dest[i] = '\0';
return (dest);
}
| [
"contact@valentin-bonnet99.fr"
] | contact@valentin-bonnet99.fr |
75fc4d010da73e3d909217079ae4035c5fa3c967 | 79d343002bb63a44f8ab0dbac0c9f4ec54078c3a | /lib/libc/include/any-linux-any/linux/dvb/ca.h | 9361e58df9d8a32c2bf826ba3fb7d4a7b4e0c0f1 | [
"MIT"
] | permissive | ziglang/zig | 4aa75d8d3bcc9e39bf61d265fd84b7f005623fc5 | f4c9e19bc3213c2bc7e03d7b06d7129882f39f6c | refs/heads/master | 2023-08-31T13:16:45.980913 | 2023-08-31T05:50:29 | 2023-08-31T05:50:29 | 40,276,274 | 25,560 | 2,399 | MIT | 2023-09-14T21:09:50 | 2015-08-06T00:51:28 | Zig | UTF-8 | C | false | false | 3,509 | h | /* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
/*
* ca.h
*
* Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
* & Marcus Metzler <marcus@convergence.de>
* for convergence integrated media GmbH
*/
#ifndef _DVBCA_H_
#define _DVBCA_H_
/**
* struct ca_slot_info - CA slot interface types and info.
*
* @num: slot number.
* @type: slot type.
* @flags: flags applicable to the slot.
*
* This struct stores the CA slot information.
*
* @type can be:
*
* - %CA_CI - CI high level interface;
* - %CA_CI_LINK - CI link layer level interface;
* - %CA_CI_PHYS - CI physical layer level interface;
* - %CA_DESCR - built-in descrambler;
* - %CA_SC -simple smart card interface.
*
* @flags can be:
*
* - %CA_CI_MODULE_PRESENT - module (or card) inserted;
* - %CA_CI_MODULE_READY - module is ready for usage.
*/
struct ca_slot_info {
int num;
int type;
#define CA_CI 1
#define CA_CI_LINK 2
#define CA_CI_PHYS 4
#define CA_DESCR 8
#define CA_SC 128
unsigned int flags;
#define CA_CI_MODULE_PRESENT 1
#define CA_CI_MODULE_READY 2
};
/**
* struct ca_descr_info - descrambler types and info.
*
* @num: number of available descramblers (keys).
* @type: type of supported scrambling system.
*
* Identifies the number of descramblers and their type.
*
* @type can be:
*
* - %CA_ECD - European Common Descrambler (ECD) hardware;
* - %CA_NDS - Videoguard (NDS) hardware;
* - %CA_DSS - Distributed Sample Scrambling (DSS) hardware.
*/
struct ca_descr_info {
unsigned int num;
unsigned int type;
#define CA_ECD 1
#define CA_NDS 2
#define CA_DSS 4
};
/**
* struct ca_caps - CA slot interface capabilities.
*
* @slot_num: total number of CA card and module slots.
* @slot_type: bitmap with all supported types as defined at
* &struct ca_slot_info (e. g. %CA_CI, %CA_CI_LINK, etc).
* @descr_num: total number of descrambler slots (keys)
* @descr_type: bitmap with all supported types as defined at
* &struct ca_descr_info (e. g. %CA_ECD, %CA_NDS, etc).
*/
struct ca_caps {
unsigned int slot_num;
unsigned int slot_type;
unsigned int descr_num;
unsigned int descr_type;
};
/**
* struct ca_msg - a message to/from a CI-CAM
*
* @index: unused
* @type: unused
* @length: length of the message
* @msg: message
*
* This struct carries a message to be send/received from a CI CA module.
*/
struct ca_msg {
unsigned int index;
unsigned int type;
unsigned int length;
unsigned char msg[256];
};
/**
* struct ca_descr - CA descrambler control words info
*
* @index: CA Descrambler slot
* @parity: control words parity, where 0 means even and 1 means odd
* @cw: CA Descrambler control words
*/
struct ca_descr {
unsigned int index;
unsigned int parity;
unsigned char cw[8];
};
#define CA_RESET _IO('o', 128)
#define CA_GET_CAP _IOR('o', 129, struct ca_caps)
#define CA_GET_SLOT_INFO _IOR('o', 130, struct ca_slot_info)
#define CA_GET_DESCR_INFO _IOR('o', 131, struct ca_descr_info)
#define CA_GET_MSG _IOR('o', 132, struct ca_msg)
#define CA_SEND_MSG _IOW('o', 133, struct ca_msg)
#define CA_SET_DESCR _IOW('o', 134, struct ca_descr)
/* This is needed for legacy userspace support */
typedef struct ca_slot_info ca_slot_info_t;
typedef struct ca_descr_info ca_descr_info_t;
typedef struct ca_caps ca_caps_t;
typedef struct ca_msg ca_msg_t;
typedef struct ca_descr ca_descr_t;
#endif | [
"andrew@ziglang.org"
] | andrew@ziglang.org |
053ced8ae51d2b8292c91c75fa807c014c3b315e | 3950acfb2a02a976f0b1b4609d264345d879c284 | /Progra/Exercices/ex01_06/ex01_06.c | a9b44fc55fc121dfe1acb9a8d38a90c023eb0164 | [] | no_license | RaphaelJ/Cours-1ere-annee | b36b122799c0317487ce5f1e203a61d9c56b25c8 | 5437af8b3af40cf8c5a8bc7fa4710a6bde9ca859 | refs/heads/master | 2016-09-10T11:22:26.696127 | 2011-12-18T22:50:53 | 2011-12-18T22:50:53 | 3,008,423 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 327 | c | #include <stdio.h>
#include <stdlib.h>
float FarhToCelcius(float fahrenheit)
{
return 5 * (fahrenheit - 32) / 9;
}
int main(void)
{
float fahrenheit;
printf("Degres fahrenheit: ");
scanf("%f", &fahrenheit);
printf("%.2f F = %.2f C\n",
fahrenheit,
FarhToCelcius(fahrenheit));
return 0;
}
| [
"raphaeljavaux@gmail.com"
] | raphaeljavaux@gmail.com |
55975aed255f23cf124faf47af5e8d8d6badc97c | 4f174018593c22079ca1a4bffad67a25b6c96d75 | /scc/core/tree/tree_misc.h | 08582b9cd00586b399b9892eda2e7341984440d8 | [] | no_license | gtsolg/scc | 4b139dae201e95d7b4be71f7b31a6f63144edd79 | 763a89ee2072bcf9d330ad7312f881d15075aff6 | refs/heads/master | 2021-01-11T09:29:55.850555 | 2017-04-15T03:26:33 | 2017-04-15T03:26:33 | 81,212,896 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,874 | h | #ifndef TREE_MISC_H
#define TREE_MISC_H
#include "tree_node.h"
static union tree_node __null_node;
#define TREE_NULL &__null_node
extern tree tree_create(struct allocator* alloc, enum tree_node_kind kind);
extern tree tree_copy(struct allocator* alloc, tree node);
extern void tree_delete(struct allocator* alloc, tree node);
extern void tree_delete_recursive(struct allocator* alloc, tree node);
extern tree tree_exp_stmt_create(struct allocator* alloc, tree decls, tree base);
extern tree tree_type_create(struct allocator* alloc, enum type_kind kind, enum type_qualifier qual, tree type);
extern tree tree_ident_create(struct allocator* alloc, strref_t ref);
extern tree tree_var_decl_create(struct allocator* alloc, tree var_name, tree base);
extern tree tree_list_node_create(struct allocator* alloc, tree base);
extern tree tree_exp_create(struct allocator* alloc, enum operator_kind kind, unsigned nesting, const struct tree_exp_info* opinfo);
extern tree tree_list_create(struct allocator* alloc);
extern void tree_list_nodes_delete(struct allocator* alloc, tree list);
extern void tree_list_delete(struct allocator* alloc, tree list);
extern union tree_node tree_list_initf(tree list);
extern tree tree_const_int_create(struct allocator* alloc, uint64_t val);
extern tree tree_const_real_create(struct allocator* alloc, long double val);
extern tree tree_const_float_create(struct allocator* alloc, float val);
extern tree tree_const_string_create(struct allocator* alloc, strref_t ref);
extern tree tree_attrib_create(struct allocator* alloc, uint64_t att);
extern tree tree_vector_type_create(struct allocator* alloc, tree type, uint64_t size);
extern tree tree_sign_type_create(struct allocator* alloc, tree res, tree args);
static inline void tree_swap(tree* a, tree* b)
{
tree t = *a;
*a = *b;
*b = t;
}
#endif // !TREE_ALLOC_H
| [
"hsfk@yandex.ru"
] | hsfk@yandex.ru |
1b800a57fe49a3fdfb4793cd2fc1645d442ea2ca | 269b0f69f7c930a8923fc3b50f5220999b7caad3 | /utils/libft/ft_memalloc.c | 789f75b53a068a9f714d2ad2c82a1f9b4c13d9c1 | [] | no_license | toqpka/wolf3d | 0768d6079b4790d0557b379c19db646a343de976 | 7ae3fb2197634359e1c56762fdef939482a228e9 | refs/heads/master | 2020-07-31T13:51:20.839991 | 2019-10-12T11:25:46 | 2019-10-12T11:25:46 | 210,624,131 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,089 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memalloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhoppe <jhoppe@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/26 13:56:00 by jhoppe #+# #+# */
/* Updated: 2019/09/17 21:49:56 by gwaymar- ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memalloc(size_t size)
{
void *fresh_mem;
if (!(fresh_mem = (void *)malloc(sizeof(void) * size)))
return (NULL);
ft_bzero(fresh_mem, size);
return (fresh_mem);
}
| [
"gwaymar-@oa-e6.21-school.ru"
] | gwaymar-@oa-e6.21-school.ru |
dea25363430277abfc03a82b75765a4f3ab4cea6 | b54ab87a6236fe40d4d70e745464c4102bb28690 | /stm32/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc/usbh_msc.h | 3fee550e0b98cf70a079c6b52c262a4a1a7b5fc8 | [
"MIT"
] | permissive | Veyronix/MQTT_Thermometer | d0ac52a6d5ddec57e36176626a28c473374f61f3 | de643ea470995188f0c4a96becbb0bdc6cad1113 | refs/heads/master | 2020-04-15T02:04:01.446290 | 2019-01-13T17:23:11 | 2019-01-13T17:23:11 | 164,301,876 | 0 | 2 | MIT | 2020-03-09T13:29:19 | 2019-01-06T11:46:26 | C | UTF-8 | C | false | false | 6,785 | h | /**
******************************************************************************
* @file usbh_msc.h
* @author MCD Application Team
* @brief This file contains all the prototypes for the usbh_msc.c
******************************************************************************
* @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.
*
******************************************************************************
*/
/* Define to prevent recursive ----------------------------------------------*/
#ifndef __USBH_MSC_H
#define __USBH_MSC_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "usbh_core.h"
#include "usbh_msc_bot.h"
#include "usbh_msc_scsi.h"
/** @addtogroup USBH_LIB
* @{
*/
/** @addtogroup USBH_CLASS
* @{
*/
/** @addtogroup USBH_MSC_CLASS
* @{
*/
/** @defgroup USBH_MSC_CORE
* @brief This file is the Header file for usbh_msc.c
* @{
*/
/** @defgroup USBH_MSC_CORE_Exported_Types
* @{
*/
typedef enum
{
MSC_INIT = 0,
MSC_IDLE,
MSC_TEST_UNIT_READY,
MSC_READ_CAPACITY10,
MSC_READ_INQUIRY,
MSC_REQUEST_SENSE,
MSC_READ,
MSC_WRITE,
MSC_UNRECOVERED_ERROR,
MSC_PERIODIC_CHECK,
}
MSC_StateTypeDef;
typedef enum
{
MSC_OK,
MSC_NOT_READY,
MSC_ERROR,
}
MSC_ErrorTypeDef;
typedef enum
{
MSC_REQ_IDLE = 0,
MSC_REQ_RESET,
MSC_REQ_GET_MAX_LUN,
MSC_REQ_ERROR,
}
MSC_ReqStateTypeDef;
#ifndef MAX_SUPPORTED_LUN
#define MAX_SUPPORTED_LUN 2U
#endif
/* Structure for LUN */
typedef struct
{
MSC_StateTypeDef state;
MSC_ErrorTypeDef error;
USBH_StatusTypeDef prev_ready_state;
SCSI_CapacityTypeDef capacity;
SCSI_SenseTypeDef sense;
SCSI_StdInquiryDataTypeDef inquiry;
uint8_t state_changed;
}
MSC_LUNTypeDef;
/* Structure for MSC process */
typedef struct _MSC_Process
{
uint32_t max_lun;
uint8_t InPipe;
uint8_t OutPipe;
uint8_t OutEp;
uint8_t InEp;
uint16_t OutEpSize;
uint16_t InEpSize;
MSC_StateTypeDef state;
MSC_ErrorTypeDef error;
MSC_ReqStateTypeDef req_state;
MSC_ReqStateTypeDef prev_req_state;
BOT_HandleTypeDef hbot;
MSC_LUNTypeDef unit[MAX_SUPPORTED_LUN];
uint16_t current_lun;
uint16_t rw_lun;
uint32_t timer;
}
MSC_HandleTypeDef;
/**
* @}
*/
/** @defgroup USBH_MSC_CORE_Exported_Defines
* @{
*/
#define USB_REQ_BOT_RESET 0xFFU
#define USB_REQ_GET_MAX_LUN 0xFEU
/* MSC Class Codes */
#define USB_MSC_CLASS 0x08U
/* Interface Descriptor field values for HID Boot Protocol */
#define MSC_BOT 0x50U
#define MSC_TRANSPARENT 0x06U
/**
* @}
*/
/** @defgroup USBH_MSC_CORE_Exported_Macros
* @{
*/
/**
* @}
*/
/** @defgroup USBH_MSC_CORE_Exported_Variables
* @{
*/
extern USBH_ClassTypeDef USBH_msc;
#define USBH_MSC_CLASS &USBH_msc
/**
* @}
*/
/** @defgroup USBH_MSC_CORE_Exported_FunctionsPrototype
* @{
*/
/* Common APIs */
uint8_t USBH_MSC_IsReady (USBH_HandleTypeDef *phost);
/* APIs for LUN */
uint8_t USBH_MSC_GetMaxLUN (USBH_HandleTypeDef *phost);
uint8_t USBH_MSC_UnitIsReady (USBH_HandleTypeDef *phost, uint8_t lun);
USBH_StatusTypeDef USBH_MSC_GetLUNInfo(USBH_HandleTypeDef *phost, uint8_t lun, MSC_LUNTypeDef *info);
USBH_StatusTypeDef USBH_MSC_Read(USBH_HandleTypeDef *phost,
uint8_t lun,
uint32_t address,
uint8_t *pbuf,
uint32_t length);
USBH_StatusTypeDef USBH_MSC_Write(USBH_HandleTypeDef *phost,
uint8_t lun,
uint32_t address,
uint8_t *pbuf,
uint32_t length);
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __USBH_MSC_H */
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| [
"bartekpi11@gmail.com"
] | bartekpi11@gmail.com |
3d5b63731819724faf021d79c9b0b43b669f8db6 | 7a46423ac172de8e75bb1f4543ce8ab9af207184 | /BoardSupport/main.c | 74b238ebeb7abefd5f8783a2be6fc564a4eb9640 | [] | no_license | zkan51/NEVTEX | 48bbd9d8c6b778f0bffaddda4d6737e280b291e6 | 57b60aa3f82bc80dbc65ea6776c8497f03bf30cd | refs/heads/master | 2021-01-10T01:50:51.972267 | 2015-12-02T01:40:10 | 2015-12-02T01:45:39 | 45,817,107 | 0 | 0 | null | null | null | null | GB18030 | C | false | false | 1,663 | c | #include "lpc177x_8x_gpio.h"
#include "lpc177x_8x_clkpwr.h"
#include "lpc177x_8x_pinsel.h"
#include "lpc177x_8x_lcd.h"
#include "uart.h"
#include "dma.h"
#include "timer.h"
#include "lcd43.h"
//#include "w25qxx.h"
#include "pwm.h"
#include <ucos_ii.h>
// #include "exfuns.h"
#include "lpc177x_8x_eeprom.h"
#include "lpc177x_8x_uart.h"
////////
///////
//////
////
///
//
//
extern volatile int TimeMS; // Defined in GUI_X.c
void SysTick_Handler (void);
void Delay (int tick);
void App_TaskStart(void);
void SysTick_Handler (void)// SysTick中断服务函数
{
OS_CPU_SR cpu_sr;
OS_ENTER_CRITICAL(); /* Tell uC/OS-II that we are starting an ISR */
OSIntNesting++;
OS_EXIT_CRITICAL();
OSTimeTick(); /* Call uC/OS-II's OSTimeTick() */
TimeMS++;
OSIntExit(); /* Tell uC/OS-II that we are leaving the ISR */
}
void SysTick_Init(void)//SysTick_Init
{
uint32_t cclk = CLKPWR_GetCLK(CLKPWR_CLKTYPE_CPU); /* 获取系统时钟频率 */
SysTick_Config(cclk/OS_TICKS_PER_SEC - 1); /* 配置SysTick为10ms中断一次 */
}
int main(void)
{
CLKPWR_ConfigPPWR(CLKPWR_PCONP_PCGPIO, ENABLE);/* 打开GPIO外设电源,上电后GPIO电源默认是打开的,此行可去掉 */
//初始化UART0 ,UART2,打开Timer2
USER_Init();
lpc1788_Lcd_Init(); /* 初始化LCD */
lpc1788_PWM_Init();
EEPROM_Init();
// LCD_test();
//fs_test();
// exfuns_init();
// load_font(); //加载flash字库 7E 02 01 EF
App_TaskStart();
while(1);
}
/************************************* End *************************************/
| [
"596931725@qq.com"
] | 596931725@qq.com |
80ee325e9637375ee2a4badc155a4e35ca892a3a | 66a4a3bb5be5eff9b228c3971a9e5a2d153079c3 | /新建文件夹 (2)/最大数乘积.c | 2171629d6bea5841badc9a9a19c042df6012210b | [] | no_license | master123874/beautiful | b2a5134518f2f57910e1907d20c9ed8a77b484a4 | 4fb56d7ce591541b3dd9043798a88f13dd586b96 | refs/heads/master | 2020-09-01T04:52:16.859956 | 2019-11-17T15:22:55 | 2019-11-17T15:22:55 | 218,884,058 | 0 | 0 | null | null | null | null | GB18030 | C | false | false | 896 | c | #include<stdio.h>
int main()
{
int n; /*多少组测试数据*/
scanf("%d",&n);
int i; /*循环变量*/
for(i=0;i<n;i++)
{
int m,t; /*m保存多少个数t保存从多少个数中找最大值*/
scanf("%d %d",&m,&t);
int a[m]; /*定义数组保存数字*/
int j;
int count=0;
int max,flag=0;
for(j=0;j<m;j++)scanf("%d",&a[j]);
for(j=0;j<m;j++)
{
count=1;
int result=a[j];
if(count==t)
{
if(!flag)
{
max=result;
flag=1;
}
else if(max<result)
max=result;
count=0;
}
else
{
int t1=j+1;
int t2=t1;
int t3=result;
int t4=1;
for(;t1<m;t1++)
{
result*=a[t1];
count++;
if(count==t)
{
if(!flag)
{
max=result;
flag=1;
}
else if(max<result)
max=result;
count=0;
}
}
}
}
printf("%d",max);
}
}
| [
"master_26222@163.com"
] | master_26222@163.com |
18adf07390bff17e16e5a2db88cb3f34e2b82d03 | ab1c643f224197ca8c44ebd562953f0984df321e | /pchealth/sr/rstrcore/resource.h | 3bb383c75422bb28500afd242e0dd58de7bc0366 | [] | no_license | KernelPanic-OpenSource/Win2K3_NT_admin | e162e0452fb2067f0675745f2273d5c569798709 | d36e522f16bd866384bec440517f954a1a5c4a4d | refs/heads/master | 2023-04-12T13:25:45.807158 | 2021-04-13T16:33:59 | 2021-04-13T16:33:59 | 357,613,696 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 4,916 | h | /******************************************************************************
Copyright (c) 2000 Microsoft Corporation
Module Name:
resource.h
Abstract:
Contains constant definitions for resources.
Revision History:
Seong Kook Khang (SKKhang) 06/20/00
created
******************************************************************************/
#ifndef _RESOURCE_H__INCLUDED_
#define _RESOURCE_H__INCLUDED_
#pragma once
/////////////////////////////////////////////////////////////////////////////
//
// CONSTANTS
//
/////////////////////////////////////////////////////////////////////////////
#define IDC_STATIC -1
#ifndef TBS_DOWNISLEFT
#define TBS_DOWNISLEFT 0x0400
#endif
/////////////////////////////////////////////////////////////////////////////
//
// ICON IDs
//
/////////////////////////////////////////////////////////////////////////////
#define IDI_SYSTEMRESTORE 101
#define IDI_DRIVE_FIXED 102
/////////////////////////////////////////////////////////////////////////////
//
// BITMAP IDs
//
/////////////////////////////////////////////////////////////////////////////
#define IDB_PROG_BRAND4 111
#define IDB_PROG_BRAND8 112
/////////////////////////////////////////////////////////////////////////////
//
// STRING IDs
//
/////////////////////////////////////////////////////////////////////////////
#define IDS_SYSTEMRESTORE 256
#define IDS_DRVSTAT_ACTIVE 272
#define IDS_DRVSTAT_FROZEN 273
#define IDS_DRVSTAT_EXCLUDED 274
#define IDS_DRVSTAT_OFFLINE 282
#define IDS_DRIVEPROP_TITLE 275
#define IDS_DRIVE_SUMMARY 276
#define IDS_SYSDRV_CANNOT_OFF 277
#define IDS_DRVLIST_COL_NAME 278
#define IDS_DRVLIST_COL_STATUS 279
#define IDS_CONFIRM_TURN_SR_OFF 280
#define IDS_CONFIRM_TURN_DRV_OFF 281
#define IDS_GROUP_POLICY_ON_OFF 283
#define IDS_GROUP_POLICY_CONFIG_ON_OFF 284
#define IDS_RESTORE_POINT_TEXT 288
#define IDS_ERROR_LOWPRIVILEGE 289
#define IDS_DRIVE_SUMMARY_NO_LABEL 290
#define IDS_SYSDRV_CANNOT_OFF_NO_LABEL 291
#define IDS_PROGRESS_PREPARE 292
#define IDS_PROGRESS_RESTORE 293
#define IDS_PROGRESS_SNAPSHOT 294
#define IDS_ERR_SR_SAFEMODE 295
#define IDS_ERR_SR_ON_OFF 296
#define IDS_SYSTEM_CHECKPOINT_TEXT 297
/////////////////////////////////////////////////////////////////////////////
//
// DIALOG IDs
//
/////////////////////////////////////////////////////////////////////////////
// Common Control IDs for Configuration Dialogs
//
// NOTE:
// The ID range from 1010 to 1019 are reserved for controls those
// should be disabled if SR is turned off.
//
#define IDC_TURN_OFF 1001
#define IDC_DRIVE_SUMMARY 1002
#define IDC_USAGE_GROUPBOX 1011 // Usage Settings Group-Box (static)
#define IDC_USAGE_HOWTO 1012 // Usage Settings Explanation Text (static)
#define IDC_USAGE_LABEL 1013 // Slider Label Text (static)
#define IDC_USAGE_SLIDER 1014 // Slider to Adjust Usage
#define IDC_USAGE_MIN 1015 // Label indicating Slider "Min"
#define IDC_USAGE_MAX 1016 // Label indicating Slider "Max"
#define IDC_USAGE_VALUE 1017 // Current Usage Value Text
#define IDC_DCU_HOWTO 1021 // Disk Cleanup Utility Explanation Text For Single Drive
#define IDC_DCU_INVOKE 1022 // Button to Run Disk Cleanup Utility
#define IDC_SYSTEM_DCU_HOWTO 1023 // Disk Cleanup Utility Explanation Text For System Drive (with multiple drives)
#define IDC_NORMAL_DCU_HOWTO 1024 // Disk Cleanup Utility Explanation Text For Normal Drive (with multiple drives)
// System Restore Tab for System CPL, Single Drive
//
#define IDD_SYSPROP_SINGLE 11
#define IDC_SD_STATUS 1101 // Status Text for Single Drive
#define IDC_SD_ICON 1102 // Drive Icon for Single Drive
// System Restore Tab for System CPL, Multiple Drives
//
#define IDD_SYSPROP_MULTI 12
#define IDC_DRIVE_GROUPBOX 1201
#define IDC_DRIVE_HOWTO 1202
#define IDC_DRIVE_LABEL 1203
#define IDC_DRIVE_LIST 1204 // List Control for Drives
#define IDC_DRIVE_SETTINGS 1205 // Button to Invoke Settings Dialog
#define IDC_RESTOREHELP_LINK 1206 // link to launch restore UI
// System Drive Settings Dialog for Multiple Drives
//
#define IDD_SYSPROP_SYSTEM 13
#define IDC_SYSDRV_CANNOT_OFF 1301
// Normal Drive Settings Dialog for Multiple Drives
//
#define IDD_SYSPROP_NORMAL 14
// Frozen Drive Settings Dialogs
//
#define IDD_SYSPROP_SYSTEM_FROZEN 15
#define IDD_SYSPROP_NORMAL_FROZEN 16
// Progress Dialog Box
//
#define IDD_PROGRESS 21
#define IDC_PROGDLG_BRAND 2101
#define IDC_PROGDLG_BITMAP 2102
#define IDC_PROGDLG_TITLE 2103
#define IDC_PROGDLG_BAR 2104
#define IDC_PROGDLG_STATUS 2105
#endif //_RESOURCE_H__INCLUDED_
| [
"polarisdp@gmail.com"
] | polarisdp@gmail.com |
5e55ea69e9e2fdeac62038d0758692335b9eb3fd | 09d7cb6e4ec4788b400cfd6abac242d1877017e1 | /ch5/ex5_9.c | 1810ede6c187379d58b8ea455eb71e5c47d60232 | [] | no_license | wayne05/C | c77cd74fcd72e7c81e75dcd06d25b9901c9bc741 | 81ef21cda34f41c3c0b1a1173299e56be9d615fd | refs/heads/master | 2021-08-21T21:05:32.429127 | 2017-11-29T02:51:04 | 2017-11-29T02:51:04 | 112,413,886 | 0 | 0 | null | null | null | null | BIG5 | C | false | false | 1,141 | c | /* ex7-4d.c */
#include <stdio.h>
void ex5_9(void)
{
int i, j, temp, flag, size;
int left, right, mid, kd, bingo;
int arr[] = { 80, 50, 40, 35, 20, 60 };
size = sizeof(arr) / sizeof(int);
/**********Bubble sort*************/
for (i = 0; i<size - 1; i++) {
flag = 0;
for (j = 0; j<size - i - 1; j++)
if (arr[j] > arr[j + 1]) {
flag = 1;
temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
if (flag == 0)
break;
}
for (i = 0; i <= size - 1; i++)
printf("%d ", arr[i]);
printf("\n\n");
/***********Binary search***********/
printf("您要尋找那一個數字(輸入是英文字母將結束): ");
while (scanf("%d", &kd) == 1) {
left = 0;
right = size - 1;
bingo = 0;
while (left <= right) {
mid = (left + right) / 2;
if (kd == arr[mid]) {
bingo = 1;
break;
}
if (kd < arr[mid])
right = mid - 1;
else
left = mid + 1;
}
if (bingo == 1)
printf("在 arr[%d] 找到 %d.\n", mid, kd);
else
printf("對不起,查無此資料! \n");
printf("\n您要尋找那一個數字(輸入是英文字母將結束): ");
}
//system("PAUSE");
//return 0;
} | [
"wayne50102@gmail.com"
] | wayne50102@gmail.com |
87dc6755bf8420e530b5d2048d6a58d45201ecb9 | 1d201504615b58da4b39e660a9afdaa547e7c2dd | /C/Gookin_CAIO/book 5 - Disk/required2.c | 7c99994d25c107a4a67cf0f12d8a94fdcb013974 | [
"Unlicense"
] | permissive | Mugurell/Learning | 6e9a20233c6abe4d8b30fadb0275988d6bff70b7 | 835a295c060807be9b98ad9bfc3d80f12e2542f5 | refs/heads/master | 2021-01-19T18:10:43.330159 | 2015-09-30T18:12:49 | 2015-09-30T18:12:49 | 37,540,346 | 1 | 0 | null | 2015-09-30T18:12:50 | 2015-06-16T15:54:52 | C++ | UTF-8 | C | false | false | 567 | c | #include <stdio.h>
int main(int argc, char* argv[])
{
if (argc <= 2)
puts("\nNot enough arguments\n");
else {
printf("\nSo you had %d arguments\n\n", argc);
if (argc == 3 || argc == 4) {
printf("I shall now work on %d and %d arguments..", 2, 3);
printf("That being %s and %s", argv[2], argv[3]);
} else {
printf("I shall now work on %d and %d arguments..\n", 2, argc - 1);
printf("That being %s and %s", argv[2], argv[argc-1]);
}
}
return 0;
} | [
"petrumugurel@gmail.com"
] | petrumugurel@gmail.com |
6c63ce1e5dd9ef06646d859ce4561731d5022e32 | 03d006ed05dfcc5f78af40ff14a805b0cfe72094 | /Coding_Practice/2751_Sorting_number_2.c | b46cdcfab92174075e7ced3f36156584579b68fb | [] | no_license | colagom42/Refrigerator | 34a15fad158154bfae2619c28ab2db4b4578cd1b | e1d38cfa880ae6752de612d8e62e6be3a1be1620 | refs/heads/master | 2021-12-24T11:13:30.715656 | 2021-08-15T10:58:56 | 2021-08-15T10:58:56 | 176,268,799 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 553 | c | #include <stdio.h>
#include<stdlib.h>
int compare(const void *a, const void *b);
int main()
{
int sum = 0;
int case_num;
scanf("%d", &case_num);
int *A_arr = malloc(sizeof(int) * case_num);
for (int i = 0; i < case_num; i++)
{
scanf("%d", &A_arr[i]);
}
qsort(A_arr, case_num, sizeof(int), compare);
for (int i = 0; i < case_num; i++)
{
printf("%d\n", A_arr[i]);
}
}
int compare(const void *a, const void *b)
{
int num1 = *(int *)a;
int num2 = *(int *)b;
if (num1 < num2)
return -1;
if (num1 > num2)
return 1;
return 0;
}
| [
"colagom42@gmail.com"
] | colagom42@gmail.com |
2495c6cc1ea6a59e9b913e18a9f89c131d37d88c | ae79575731d4a37238a4e88687c0ca946a571e81 | /app/vector_data_unit/vdu_demo/src/process/cp_vdu_demo_process.h | f0685e815c31fa4d3e61484e244ddf8c1244a234 | [] | no_license | Kitty-Kitty/clc_library | 582b1655291b9b27ccad13d2341cd8a79cf0ff30 | ac4279b3890a14ada4b62d4413a14214d242da05 | refs/heads/master | 2022-04-03T00:46:32.377928 | 2020-01-21T08:33:44 | 2020-01-21T08:33:44 | 145,491,656 | 5 | 0 | null | null | null | null | GB18030 | C | false | false | 1,176 | h | /**************************************************************************
Copyright:novigo
Author:fangzhenmu@novigo.com.cn
Date:2016-03-18
Description:
**************************************************************************/
#ifndef _CP_VDU_DEMO_PROCESS_INCLUDE_H_
#define _CP_VDU_DEMO_PROCESS_INCLUDE_H_
#include "cp_vdu_demo_process_core.h"
#include "cp_socket.h"
//typedef struct cp_vdu_demo_process_s cp_vdu_demo_process_t;
#pragma pack(1)
#define CP_VDU_DEMO_PROCESS_FIELDS \
CP_PROCESS_FIELDS \
/************************************************************************/
/* */
/************************************************************************/
struct cp_vdu_demo_process_s {
CP_VDU_DEMO_PROCESS_FIELDS /*表示时间模块信息*/
};
#pragma pack()
cp_vdu_demo_process_t* create_vdu_demo_process(cp_module_register_t *register_info, cp_socket_manager_t *manager, cp_vdu_demo_process_info_t *info);
cp_int32_t destroy_vdu_demo_process(cp_vdu_demo_process_manager_t *manager, cp_vdu_demo_process_t* vdu_demo_process);
#endif
| [
"armuxinxian@aliyun.com"
] | armuxinxian@aliyun.com |
74edfa4385f334ca36890e99a891ca316adc1747 | d7db3d7e2c3f4f9fd27c01d381f8f480d7ab774e | /0x1A-sorting_algorithms/sort.h | 31f0aabc3d8606eba8f0534c61130d81594e46cb | [] | no_license | davidknoppers/holbertonschool-low_level_programming | 0d0a3ef8631d00fffe1a175f5bfb5da0268b939d | e59bda1bda44e93bc38b9b4d669c55fba61ec3f8 | refs/heads/master | 2021-05-04T07:55:48.666391 | 2017-06-17T02:13:09 | 2017-06-17T02:13:09 | 70,721,770 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 1,268 | h | #ifndef SORT_EM
#define SORT_EM
#include <stdlib.h>
/**
* struct listint_s - Doubly linked list node
*
* @n: Integer stored in the node
* @prev: Pointer to the previous element of the list
* @next: Pointer to the next element of the list
*/
typedef struct listint_s
{
const int n;
struct listint_s *prev;
struct listint_s *next;
} listint_t;
void print_array(const int *array, size_t size);
void print_list(const listint_t *list);
/* 0-bubble_sort.c, 0-O */
void bubble_sort(int *array, size_t size);
/* 1-insertion_sort_list.c, 1-O */
void insertion_sort_list(listint_t **list);
/* 2-selection_sort.c, 2-O */
void selection_sort(int *array, size_t size);
/* 3-quick_sort.c, 3-O */
void quick_sort(int *array, size_t size);
/* 100-shell_sort.c */
void shell_sort(int *array, size_t size);
/* 101-cocktail_sort_list.c, 101-O */
void cocktail_sort_list(listint_t **list);
/* 102-counting_sort.c, 102-O */
void counting_sort(int *array, size_t size);
/* 103-merge_sort.c, 103-O */
void merge_sort(int *array, size_t size);
/* 104-heap_sort.c, 104-O */
void heap_sort(int *array, size_t size);
/* 105-radix_sort.c, 105-O */
void radix_sort(int *array, size_t size);
/* 106-bitonic_sort.c, 106-O */
void bitonic_sort(int *array, size_t size);
#endif
| [
"david.knoppers@holbertonschool.com"
] | david.knoppers@holbertonschool.com |
02ce6ec27d6c5a1d2a631724d6b84e479ce6fe6e | f36b1063d1e6cd0eb756be4f93e6b70ea1caaf5a | /09-Ejercicios temas 04-08/eje2.3.c | 0cf7eac3799aadb61ba233e28e8690c23f5dd045 | [] | no_license | vareladev/fundamentos-programacion | 333fc0295121352fba7f8eab92f89efecc09ad33 | 9f3fa412a0fa2e5b1ebbad1e95eeca0847cd3ba4 | refs/heads/master | 2020-03-29T23:22:19.746479 | 2018-11-30T22:03:04 | 2018-11-30T22:03:04 | 150,464,495 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,150 | c | /******************************************************************************
Fundamentos de programación. Introducción a lenguaje C.
ejemplo 2.3:
Cree un programa en C que dada la cantidad de dinero S, el interés I y el
número en años N que han pasado desde que el cliente puso su dinero a plazo
fijo en intervalos de un año, calcule y muestre el saldo de la cuenta,
además, si la cuenta fue cerrada se deberá indicar.
Autor: Erick Varela, v1.0.
*******************************************************************************/
//librerias
#include <stdio.h>
#include <math.h>
//macros
#define TRUE 1
//función principal
int main(void){
//declaración de variables locales
float s;
float i;
int t;
float res;
//solicitando datos al usuario
printf("Ingrese la cantidad S: $");
scanf("%f", &s);
printf("Ingrese interés I: ");
scanf("%f", &i);
printf("Ingrese el tiempo en años: ");
scanf("%d", &t);
//validando tiempo
if(t>=50){
printf("La cuenta ha sido cerrada. \n");
return 0;
}
i = i / 100;
for(int j=0;j<t;j++){
res = s * pow((1 + i),j+1);
printf("\tAño %d: $%.2f\n",j+1,res);
}
return 0;
}
| [
"varela.dev@gmail.com"
] | varela.dev@gmail.com |
182801136d8850a8986da3c2f098ce0ef38e3f8c | 948f4e13af6b3014582909cc6d762606f2a43365 | /testcases/juliet_test_suite/testcases/CWE122_Heap_Based_Buffer_Overflow/s10/CWE122_Heap_Based_Buffer_Overflow__c_CWE806_wchar_t_ncpy_65b.c | cdb03224f85482ce5585de76dea142acfa57be43 | [] | no_license | junxzm1990/ASAN-- | 0056a341b8537142e10373c8417f27d7825ad89b | ca96e46422407a55bed4aa551a6ad28ec1eeef4e | refs/heads/master | 2022-08-02T15:38:56.286555 | 2022-06-16T22:19:54 | 2022-06-16T22:19:54 | 408,238,453 | 74 | 13 | null | 2022-06-16T22:19:55 | 2021-09-19T21:14:59 | null | UTF-8 | C | false | false | 1,635 | c | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE806_wchar_t_ncpy_65b.c
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE806.label.xml
Template File: sources-sink-65b.tmpl.c
*/
/*
* @description
* CWE: 122 Heap Based Buffer Overflow
* BadSource: Initialize data as a large string
* GoodSource: Initialize data as a small string
* Sinks: ncpy
* BadSink : Copy data to string using wcsncpy
* Flow Variant: 65 Data/control flow: data passed as an argument from one function to a function in a different source file called via a function pointer
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifndef OMITBAD
void CWE122_Heap_Based_Buffer_Overflow__c_CWE806_wchar_t_ncpy_65b_badSink(wchar_t * data)
{
{
wchar_t dest[50] = L"";
/* POTENTIAL FLAW: Possible buffer overflow if data is larger than dest */
wcsncpy(dest, data, wcslen(data));
dest[50-1] = L'\0'; /* Ensure the destination buffer is null terminated */
printWLine(data);
free(data);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE122_Heap_Based_Buffer_Overflow__c_CWE806_wchar_t_ncpy_65b_goodG2BSink(wchar_t * data)
{
{
wchar_t dest[50] = L"";
/* POTENTIAL FLAW: Possible buffer overflow if data is larger than dest */
wcsncpy(dest, data, wcslen(data));
dest[50-1] = L'\0'; /* Ensure the destination buffer is null terminated */
printWLine(data);
free(data);
}
}
#endif /* OMITGOOD */
| [
"yzhang0701@gmail.com"
] | yzhang0701@gmail.com |
f0a21f179f7f0e08c57edb90720005e651a5bd79 | d028ba4e480c1928e2bcf4fa46ae3c13010fa55d | /ch19_codes/E5/queue.h | fad2a62a5009f62ac33e6385277433dfe111b625 | [] | no_license | philipdongfei/CProgramming_AModernApproach | 1e02cffd51ba838f38abe2339876a69db297c6af | d091023840bbb5ad983829b35a25dfc375a388a6 | refs/heads/master | 2021-06-21T23:55:34.940043 | 2020-12-06T06:52:06 | 2020-12-06T06:52:06 | 153,377,350 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 382 | h | #ifndef QUEUE_H
#define QUEUE_H
#include <stdbool.h>
#define PUBLIC
#define PRIVATE static
#define QUEUE_SIZE 100
typedef int Item;
typedef struct {
Item contents[QUEUE_SIZE];
int first;
int last;
}Queue;
void enqueue(Queue *q, Item n);
Item dequeue(Queue *q);
Item getFirst(const Queue *q);
Item getLast(const Queue *q);
bool is_empty(const Queue *q);
#endif
| [
"philip.dongfei@gmail.com"
] | philip.dongfei@gmail.com |
51c76536a396dda83fcdd9dccc766fd6d8f222ab | a03a7935a191d63bee76fd3b85a61ee27f98904a | /src/operators/Box/BoxGUIPluginInfo.C | a425856adaa0111b31dad5b918d50e3d6204cda7 | [] | no_license | cchriste/visit | 57091c4a512ab87efd17c64c7494aa4cf01b7e53 | c72c413f571e56b52fb7221955219f11f4ba19e3 | refs/heads/master | 2020-04-12T06:25:27.458132 | 2015-10-12T15:41:49 | 2015-10-12T15:41:49 | 10,111,791 | 5 | 1 | null | null | null | null | UTF-8 | C | false | false | 4,769 | c | /*****************************************************************************
*
* Copyright (c) 2000 - 2015, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* 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 disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL 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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY 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.
*
*****************************************************************************/
// ************************************************************************* //
// File: BoxGUIPluginInfo.C
// ************************************************************************* //
#include <BoxPluginInfo.h>
#include <BoxAttributes.h>
#include <QApplication>
#include <QvisBoxWindow.h>
// ****************************************************************************
// Function: GetGUIInfo
//
// Purpose:
// Return a new GUIPluginInfo for the Box operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
extern "C" OP_EXPORT GUIOperatorPluginInfo* Box_GetGUIInfo()
{
return new BoxGUIPluginInfo;
}
// ****************************************************************************
// Method: BoxGUIPluginInfo::GetMenuName
//
// Purpose:
// Return a pointer to the name to use in the GUI menu.
//
// Returns: A pointer to the name to use in the GUI menu.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
QString *
BoxGUIPluginInfo::GetMenuName() const
{
return new QString(qApp->translate("OperatorNames", "Box"));
}
// ****************************************************************************
// Method: BoxGUIPluginInfo::CreatePluginWindow
//
// Purpose:
// Return a pointer to an operator's attribute window.
//
// Arguments:
// type The type of the operator.
// attr The attribute subject for the operator.
// notepad The notepad to use for posting the window.
//
// Returns: A pointer to the operator's attribute window.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
QvisPostableWindowObserver *
BoxGUIPluginInfo::CreatePluginWindow(int type, AttributeSubject *attr,
const QString &caption, const QString &shortName, QvisNotepadArea *notepad)
{
return new QvisBoxWindow(type, (BoxAttributes *)attr,
caption, shortName, notepad);
}
// ****************************************************************************
// Method: BoxGUIPluginInfo::XPMIconData
//
// Purpose:
// Return a pointer to the icon data.
//
// Returns: A pointer to the icon data.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
#include <Box.xpm>
const char **
BoxGUIPluginInfo::XPMIconData() const
{
return Box_xpm;
}
| [
"bonnell@18c085ea-50e0-402c-830e-de6fd14e8384"
] | bonnell@18c085ea-50e0-402c-830e-de6fd14e8384 |
63f37ff6e19ceaef3bf95e1dd4d9bbf746513da1 | 1a0565eaeb6d146b4445465ac42197224534b944 | /Lab/5/s5/3/shm-server.c | 3d889f43db94a9621be96e27b27f4e5217854770 | [] | no_license | alikhorramipour/Operating_Systems | 9dc312883b1e0255e02bbf82cee81401074821dc | 69f1f78963290d32394ceb80062d0490220eec91 | refs/heads/master | 2022-11-24T10:35:25.951872 | 2020-08-01T06:38:30 | 2020-08-01T06:38:30 | 284,203,487 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 701 | c |
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <string.h>
int main(int argc, const char *argv[]) {
int shmid;
key_t key = 0x01020304;
void *addr;
shmid = shmget(key, 4096, IPC_CREAT);
if (shmid < 0) {
fprintf(stderr, "failed to create shm segment\n");
perror("shmget");
exit(EXIT_FAILURE);
}
printf("created %d\n", shmid);
addr = shmat(shmid, NULL, 0);
if ((long long) addr == -1) {
fprintf(stderr, "failed to attach\n");
perror("shmat");
exit(EXIT_FAILURE);
}
printf("got %p\n", addr);
char *data = addr;
strcpy(data, "Hello");
// while(1);
return 0;
}
| [
"alikhorramipour@gmail.com"
] | alikhorramipour@gmail.com |
734e6e76e908de011bd2b3986adf7ff7ef6403a2 | 3154d6d9e8cbc681b0ad360c18f4c2f8616ea04a | /0x06-pointers_arrays_strings/103-main.c | 1a8b034ae857308584c0dba33c99f834da8f763e | [] | no_license | matcls/holbertonschool-low_level_programming | f55e6190ef1ba2476d122e9f5f1c944b92becf56 | 16ed039a323c292f45c6c2b130ca0f5dbd6238d8 | refs/heads/master | 2021-07-25T15:00:39.647619 | 2021-01-14T21:16:07 | 2021-01-14T21:16:07 | 238,502,931 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 477 | c | #include "holberton.h"
#include <stdio.h>
/**
* main - check the code for Holberton School students.
*
* Return: Always 0.
*/
int main(void)
{
char buffer[] = "This is a string!\0And this is the rest of the #buffer :)\1\2\3\4\5\6\7#cisfun\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x20\x21\x34\x56#pointersarefun #infernumisfun\n";
printf("%s\n", buffer);
printf("---------------------------------\n");
print_buffer(buffer, sizeof(buffer));
return (0);
} | [
"manueltorresvesga@gmail.com"
] | manueltorresvesga@gmail.com |
a415052545647f0d5ae4d9a4ca47f3b098a7812c | 339404723b995180fc6116112006467452165b30 | /libft/src/ft_str_alpha.c | 1961748e6a9df54b0868a4f5a3f99dbb2b1d3bbf | [] | no_license | gvenet/minishell | 0162246c41008bed2afdeb6398a5227b28177d3e | d8c9e575b4776f64945d102243131dd1c2799889 | refs/heads/master | 2023-05-06T14:34:41.247703 | 2021-05-18T15:16:53 | 2021-05-18T15:16:53 | 368,573,745 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 182 | c | #include "libft.h"
int str_alnum(char *str)
{
int i;
i = -1;
if (!str)
return (0);
while (str[++i])
if (!ft_isalnum(str[i]) && str[i] != '_')
return (0);
return (1);
}
| [
"venetguillaume@gmail.com"
] | venetguillaume@gmail.com |
3029ac407ed85227568e32f9995be62f18667959 | b227fa671d1ce3e8c3bef3925831d1f9d06b5589 | /kalimba/lib_sets/sdk/include/multirate_operators/cbops_dc_remove.h | 7305c63ceccca899a38425ae5e2f3095ac3903c9 | [] | no_license | layne11/csr8670_adk4_1 | b9636a3a1226ee8842c8673524da0b27414a9345 | 9cf63ef4d0c015a111793af25f615b7d1c4da67e | refs/heads/master | 2021-07-12T00:15:10.877596 | 2020-09-28T01:20:57 | 2020-09-28T01:20:57 | 205,702,144 | 9 | 4 | null | null | null | null | UTF-8 | C | false | false | 892 | h | // *****************************************************************************
// Copyright (c) 2005 - 2015 Qualcomm Technologies International, Ltd.
// %%version
//
// *****************************************************************************
#ifndef CBOPS_DC_REMOVE_HEADER_INCLUDED
#define CBOPS_DC_REMOVE_HEADER_INCLUDED
.CONST $cbops.dc_remove.INPUT_START_INDEX_FIELD 0;
.CONST $cbops.dc_remove.OUTPUT_START_INDEX_FIELD 1;
.CONST $cbops.dc_remove.DC_ESTIMATE_FIELD 2;
.CONST $cbops.dc_remove.STRUC_SIZE 3;
// with fs=48KHz. Value of 0.0005 gives a 3dB point at 4Hz. (0.1dB @ 25Hz)
// this is assumed to be acceptable for all sample rates
.CONST $cbops.dc_remove.FILTER_COEF 0.0005;
#endif // CBOPS_DC_REMOVE_HEADER_INCLUDED
| [
"748821941@qq.com"
] | 748821941@qq.com |
5fcc5ae5415f4d6ec6e8db54e3a6f3b9730cdaf3 | 5c255f911786e984286b1f7a4e6091a68419d049 | /vulnerable_code/c3b3e1fc-b2a4-4ce6-916f-7dbb9e409195.c | 34de8b4639f5e8260d051382504213080244e960 | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 543 | c | #include <string.h>
#include <stdio.h>
int main() {
int i=4;
int j=14;
int k;
int l;
k = 53;
l = 64;
k = l/j;
l = i/j;
l = i/j;
l = j/j;
l = i%j;
l = j+j;
l = k-j*i;
//variables
/* START VULNERABILITY */
int a;
int b[7];
int c[39];
a = 0;
while (b[a] != 0) {
/* START BUFFER SET */
*((int *)c + a) = *((int *)b + a);
/* END BUFFER SET */
a++;
}
/* END VULNERABILITY */
printf("%d%d\n",k,l);
return 0;
}
| [
"nharmon8@gmail.com"
] | nharmon8@gmail.com |
04acc5c2f70c300c083667fc7a686cc13abf60c8 | 5fdd62f1b914a8f11bf143d88c3216b777f3398d | /inc/report_config_to_add_mod.h | ed3436d45580b2b9d67ca5bb3c7955746a3f15f7 | [] | no_license | Dybinx/NR-RRC-decode-encode-messages | 5ff1d7c874fe40f6487f73411e07b805886a26b6 | 5a6a13507dce9e5937cf255f8c250ac146a02de6 | refs/heads/master | 2020-11-25T21:58:40.513257 | 2019-12-20T08:11:22 | 2019-12-20T08:11:22 | 228,862,878 | 2 | 2 | null | null | null | null | UTF-8 | C | false | false | 1,822 | h | /* THIS FILE IS PART OF CODEC MESSAGE PROJECT ABOUT 3GPP 36.331
* report_config_to_add_mod.h - this is the header file for message: ReportConfigToAddMod
*
* THIS PROGRAM IS NOT FREE SOFTWARE.
* YOU SHOULD HAVE RECEIVED A COPY OF LICENSE FROM BINXIAN DUAN, IF NOT, THE BEHAVIOR IS TORT!
* Copyright (c) 2018 Binxian Duan <binxd@126.com>. All rights reserved.
*/
#ifndef _REPORT_CONFIG_TO_ADD_MOD_H_
#define _REPORT_CONFIG_TO_ADD_MOD_H_
#include "types.h"
#include "contants.h"
#include "handle_bits.h"
#include "report_config_id.h"
#include "report_config_nr.h"
typedef enum {
REPORTCONFIGTOADDMOD_REPORTCONFIG_REPORTCONFIGNR,
/* Extension marker start. */
REPORTCONFIGTOADDMOD_REPORTCONFIG_max = 0x7FFFFFFF
}ReportConfigToAddMod_reportConfig_e;
/* union corresponding asn: ReportConfigToAddMod_reportConfig */
typedef union {
ReportConfigNR_t reportConfigNR;
/* Extension marker start. */
}ReportConfigToAddMod_reportConfig_u;
/* struct corresponding asn: ReportConfigToAddMod_reportConfig */
typedef struct {
ReportConfigToAddMod_reportConfig_e type;
ReportConfigToAddMod_reportConfig_u a;
}ReportConfigToAddMod_reportConfig_t;
typedef struct {
ReportConfigId_t reportConfigId;
ReportConfigToAddMod_reportConfig_t reportConfig;
}ReportConfigToAddMod_t;
extern void EncodeReportConfigToAddMod(
ReportConfigToAddMod_t *i_encoded_field,
uint8 *buff,
BitsIter *bits_iter,
void *asn_error);
extern void DecodeReportConfigToAddMod(
ReportConfigToAddMod_t *o_decoded_field,
uint8 *buff,
BitsIter *bits_iter,
void *asn_error);
#endif
| [
"binxd@outlook.com"
] | binxd@outlook.com |
c04dfe364f6201a138a0933b957bf6e92045c6eb | e80e5374b8fd00379293adb35fc8cf017d5f4cc7 | /qemu_mode/qemu-2.10.0/roms/ipxe/src/include/ipxe/isqrt.h | 68255d1bc27e85eeaf2e205ac61df91d2f75f24c | [
"GPL-1.0-or-later",
"LicenseRef-scancode-ubdl",
"GPL-2.0-only",
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"LGPL-2.1-only",
"LGPL-2.0-or-later",
"LGPL-2.1-or-later",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-refere... | permissive | CAFA1/afl | dcebf3a3acae3e9783bbb79d8cff6958b496fa34 | 01c113b61ab70c3b02f3d7c74e6dfa20cfc7813d | refs/heads/master | 2023-04-10T14:30:34.901666 | 2020-07-27T01:06:32 | 2020-07-27T01:06:32 | 272,596,630 | 0 | 2 | Apache-2.0 | 2021-04-15T00:56:55 | 2020-06-16T03:03:26 | C | UTF-8 | C | false | false | 210 | h | #ifndef _IPXE_ISQRT_H
#define _IPXE_ISQRT_H
/** @file
*
* Integer square root
*
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
extern unsigned long isqrt ( unsigned long value );
#endif /* _IPXE_ISQRT_H */
| [
"longlong_vm@dell_book.com"
] | longlong_vm@dell_book.com |
2fd71d5ed37345a060e4a150fe3eb3f5adca4458 | f8190e3adfdd7d9624d16c633a8801f7df800434 | /si/Untitled Project.si4project/Backup/main(2186).c | 32c1fc409838386c26e180deb3412cf75df39f9c | [] | no_license | wensf/LovelyOS | 171baf0d6a74270c1a98c4234248823023210416 | b323dd38ad458cc3120c19f3b5f941abfbd23af2 | refs/heads/master | 2020-03-22T14:15:34.157912 | 2019-08-02T02:45:47 | 2019-08-02T02:45:47 | 140,165,002 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 7,254 | c | /**
* main.c
*
* Author : Wen Shifang
* Create 2018.07.18
* Last modify : 2018.07.18
*/
/**
* 在X86实模式下,我们使用16位代码,并且启用GCC扩展的方式,
* 汇编子程序调用本文件定义的函数时,也应该使用同样的指令
* 指定代码格式,否则调用出错.
*/
__asm__(".code16gcc");
#include <printf.h>
#include <fat16.h>
#include <console.h>
#include <libc.h>
struct kernel_param
{
int xres;
int yres;
int bpp;
int vaddr;
int vesa_mode;
int mem_cnt;
};
unsigned char sector[512];
struct vga_mode_struct
{
int mode;
int supported;
};
struct vga_mode_struct svga_mode[256] =
{
{0x100, 0},
{0x101, 0},
{0x102, 0},
{0x103, 0},
{0x104, 0},
{0x105, 0},
{0x106, 0},
{0x107, 0},
{0x108, 0},
{0x109, 0},
{0x10a, 0},
{0x10b, 0},
{0x10c, 0},
{0x113, 0},
{0x114, 0},
{0x115, 0},
{0x116, 0},
{0x117, 0},
{0x118, 0},
{0x119, 0},
{0x11a, 0},
{0x11b, 0},
};
#define XRES 1920
#define YRES 1080
#define BPP 32
struct vga_mode
{
int xre, yre, bits;
int mode;
};
const struct vga_mode kernel_supported_mode[2] =
{
{XRES,YRES,BPP,0},
{1024,768,BPP,0},
};
int get_key ( int timeout )
{
int ret = 0;
__asm__ __volatile__ ("mov $0,%%ah\n\t"
"int $0x16\n\t"
:"=a"(ret)
:
);
return (ret & 0xFFFF);
}
void clear_screen(void)
{
/**
* Clear screen
*/
__asm__ __volatile__(
"mov $0x06, %%ah\n\t"
"mov $0,%%al\n\t"
"mov $0,%%ch\n\t"
"mov $0,%%cl\n\t"
"mov $24,%%dh\n\t"
"mov $79,%%dl\n\t"
"mov $07,%%bh\n\t"
"int $0x10\n\t"
::);
}
struct kernel_param *kparam;
int init_vesa( int xres, int yres, int bpp )
{
for ( int i = 0; i < 256; i++ )
{
svga_mode[i].mode = 0x110+i;
}
/**
* INT 10H AX=4F00H Get the VBE controller Infomation.
*/
int _result;
__asm__ __volatile__ (
"mov $0x0, %%di\n\t"
"mov $0x4f00, %%ax\n\t"
"int $0x10\n\t"
:"=a"(_result)
:
);
printf("result=%04x\n", _result & 0xFFFF);
if ( (_result & 0xFFFF) == 0x004F )
{
printf("call INT 10H succeed\n");
char *vbe_p = 0x0;
printf("vbe_signature %c%c%c%c\n", vbe_p[0], vbe_p[1], vbe_p[2], vbe_p[3]);
printf("vbe version %04x\n", *((unsigned short*)(vbe_p+4)));
printf("vbe total_memory %0x4f\n", *((unsigned short*)(vbe_p+14)));
}
/**
* 下面是一些测试代码,用来查询显示器是否支持SVGA的高分辨率模式号
* 调用系统BIOS INT 10H AX=4F01H
* 返回的信息我们保存在ES:DI开始的256个字节里.
* 注意在C语言里,默认的数据段选择器是DS, 为了方便我们访问内存,
* 我们将ES设置和DS一致,为0x9000. DI设置为0X0
* INT 10H AX=4F01H功能调用将把信息存放在0x9000:0x8000.
* 这样我们在C代码中使用指针指向0地址,即0x9000:0x8000.
*/
printf("vesa attr xres yres color vram\n");
for ( int i = 0; i < /*SIZE_NR(svga_mode)*/256; i++ )
{
int _result = 0;
unsigned char *p = (unsigned char *)0;
memset( p, 0x0, 256);
__asm__ __volatile__ (
"mov $0x0, %%di\n\t"
"mov %1,%%cx\n\t"
"mov $0x4f01, %%ax\n\t"
"int $0x10\n\t"
:"=a"(_result)
:"m"(svga_mode[i].mode));
if ( (_result>>8) != 0 ) /** AH != 0 : Failed */
{
continue;
}else /** AH == 0 : Sucessed */
{
}
/**
* 打印该模式下的分辨率和显存地址.
*/
printf("%04x %02x % 4d % 4d %d %08x\n",
svga_mode[i].mode,
*((unsigned char *)(p+0)), /* attr */
*((unsigned short *)(p+18)), /* xresolution */
*((unsigned short *)(p+20)), /* yresolution */
*((unsigned char *)(p+0x19)), /* bits_per_pixel */
*((unsigned int *)(p+40)) /* vide addr */
);
if ( (*((unsigned short *)(p+18)) == xres)
&& (*((unsigned short *)(p+20)) == yres)
&& (*((unsigned char *)(p+0x19)) == bpp) )
{
kparam->xres = *((unsigned short *)(p+18));
kparam->yres = *((unsigned short *)(p+20));
kparam->bpp = *((unsigned char *)(p+0x19));
kparam->vesa_mode = svga_mode[i].mode;
kparam->vaddr = *((unsigned int *)(p+40));
return (0);
}
if ( y > 24 )
{
x = 0; y = 0;
// get_key(0);
clear_screen();
}
}
return (-1);
}
#define FLAG_CF 0x00000001
struct mem_info_struct
{
unsigned int address_low;
unsigned int address_high;
unsigned int length_low;
unsigned int length_high;
unsigned int type;
};
int memory_range_probe( int idx, unsigned char *buf )
{
int _ret, _cflags;
int len;
__asm__ __volatile__ (
"movl $0xE820, %%eax\n\t"
"movl %3, %%ebx\n\t"
"movl %4, %%edi\n\t"
"movl $0x14, %%ecx\n\t"
"movl $0x534d4150, %%edx\n\t"
"int $0x15\n\t"
:"=b"(_ret),"=a"(_cflags),"=c"(len)
:"g"(idx), "m"(buf)
:"memory"
);
return (_ret);
}
struct mem_info_struct mem_info, *mem_p;
#define SIZEOF_NR(x) (sizeof(x)/sizeof(x[0]))
int set_video(void)
{
// set vesa mode.
int _result;
int mode = kparam->vesa_mode;
__asm__ __volatile__(
"mov $0x4f02, %%ax\n\t"
"mov %1,%%bx\n\t"
"addw $0x4000,%%bx\n\t"
"int $0x10\n\t"
:"=a"(_result)
:"m"(mode)
:"bx");
return _result;
}
int main(void)
{
int r;
console_init();
printf("console_init() completed.\n");
mem_p = (struct mem_info_struct *)( 0x8000 + sizeof(struct kernel_param) );
kparam = (struct kernel_param *)(0x8000);
kparam->mem_cnt = 0;
do{
r = memory_range_probe(r,(unsigned char *)&mem_info);
memcpy(mem_p, &mem_info, sizeof(struct mem_info_struct));
mem_p++; kparam->mem_cnt++;
}while( r != 0 );
printf("%d block memory found in tatal\n", kparam->mem_cnt);
printf("Press any key to init the evsa\n");
#if 1
get_key(0);
#endif
int i = 0;
for ( ; i < SIZEOF_NR(kernel_supported_mode); i++ )
{
int xre = kernel_supported_mode[i].xre;
int yre = kernel_supported_mode[i].yre;
int bpp = kernel_supported_mode[i].bits;
if (init_vesa( xre, yre, bpp ) == 0){
break;
}
}
if ( i < SIZEOF_NR(kernel_supported_mode) )
{
printf("supported x=%d,y=%d, bit_per_pixel=%d mode=%04x video_addr=%08x\n",
kparam->xres,kparam->yres,kparam->bpp,kparam->vesa_mode,kparam->vaddr);
printf("Press any key to boot kernel");
get_key(0);
clear_screen();
return 0;
}
printf("The flow VGA mode Not supported by kernel\n");
for ( int i = 0; i < SIZEOF_NR(kernel_supported_mode); i++ )
{
int xres = kernel_supported_mode[i].xre;
int yres = kernel_supported_mode[i].yre;
int bpp = kernel_supported_mode[i].bits;
printf("%d * %d %d\n",xres,yres,bpp);
}
get_key(0);
return (-1);
}
void show_error(unsigned long error_code)
{
int _ret, _cflags;
printf("error=%08x\n", error_code);
__asm__ __volatile__ (
"xor %%eax, %%eax\n\t"
"mov $0x41, %%ah\n\t"
"mov $0x55AA, %%bx\n\t"
"mov $0x80,%%dl\n\t"
"int $0x13\n\t"
:"=b"(_ret),"=a"(_cflags)
:
:
);
printf("_ret=%08x, c_flags=%08x\n",_ret, _cflags);
while(1);
}
| [
"772148609@qq.com"
] | 772148609@qq.com |
d8bc7e14dd2fddbccebd82521d60ada918f604e7 | 63b4a698bc22fd54857c8fa097b1331f79c39e5a | /src/gdb/gdb-7.11/gdb/testsuite/gdb.perf/gm-utils.h | 0354b0097cc8299065166a154ca202787ba92048 | [
"LGPL-3.0-only",
"GPL-3.0-only",
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-copyleft",
"GPL-2.0-only",
"LGPL-2.0-only",
"LicenseRef-scancode-other-permissive",
"GPL-2.0-or-later",
"Apache-2.0",
"GPL-3.0-or-later",
"LicenseRe... | permissive | MinimSecure/unum-sdk | 67e04e2b230f9afb3ae328501a16afa4b94cdac6 | 30c63f0eccddba39a760671a831be3602842f3f4 | refs/heads/master | 2023-07-13T07:33:43.078672 | 2023-07-07T13:52:05 | 2023-07-07T13:52:05 | 143,209,329 | 33 | 22 | Apache-2.0 | 2021-03-05T22:56:59 | 2018-08-01T21:13:43 | C | UTF-8 | C | false | false | 933 | h | /* Copyright (C) 2015-2016 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef GM_UTILS_H
#define GM_UTILS_H
/* Names borrowed from include/symcat.h. */
#define CONCAT2(a,b) a ## b
#define XCONCAT2(a,b) CONCAT2 (a, b)
#define STRINGX(s) #s
#define XSTRING(s) STRINGX (s)
#endif /* GM_UTILS_H */
| [
"denis.bakin@minim.co"
] | denis.bakin@minim.co |
5a96455ffd25f2d185f676fbeeb0592d672018ae | 976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f | /source/linux/drivers/iio/gyro/extr_hid-sensor-gyro-3d.c_gyro_3d_parse_report.c | 9a3e87ae19805c1fc945a5023fdf231b70b3c6a7 | [] | no_license | isabella232/AnghaBench | 7ba90823cf8c0dd25a803d1688500eec91d1cf4e | 9a5f60cdc907a0475090eef45e5be43392c25132 | refs/heads/master | 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,175 | c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct platform_device {int /*<<< orphan*/ dev; } ;
struct iio_chan_spec {int dummy; } ;
struct hid_sensor_hub_device {int dummy; } ;
struct TYPE_5__ {scalar_t__ index; int /*<<< orphan*/ report_id; int /*<<< orphan*/ size; } ;
struct TYPE_4__ {TYPE_2__ sensitivity; } ;
struct gyro_3d_state {TYPE_1__ common_attributes; int /*<<< orphan*/ scale_post_decml; int /*<<< orphan*/ scale_pre_decml; TYPE_2__* gyro; int /*<<< orphan*/ scale_precision; } ;
/* Variables and functions */
int CHANNEL_SCAN_INDEX_X ;
int CHANNEL_SCAN_INDEX_Z ;
int /*<<< orphan*/ HID_FEATURE_REPORT ;
int /*<<< orphan*/ HID_INPUT_REPORT ;
int HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS ;
int HID_USAGE_SENSOR_DATA_ANGL_VELOCITY ;
int HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS ;
int /*<<< orphan*/ HID_USAGE_SENSOR_GYRO_3D ;
int /*<<< orphan*/ dev_dbg (int /*<<< orphan*/ *,char*,scalar_t__,int /*<<< orphan*/ ,...) ;
int /*<<< orphan*/ gyro_3d_adjust_channel_bit_mask (struct iio_chan_spec*,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ hid_sensor_format_scale (int /*<<< orphan*/ ,TYPE_2__*,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int sensor_hub_input_get_attribute_info (struct hid_sensor_hub_device*,int /*<<< orphan*/ ,unsigned int,int,TYPE_2__*) ;
__attribute__((used)) static int gyro_3d_parse_report(struct platform_device *pdev,
struct hid_sensor_hub_device *hsdev,
struct iio_chan_spec *channels,
unsigned usage_id,
struct gyro_3d_state *st)
{
int ret;
int i;
for (i = 0; i <= CHANNEL_SCAN_INDEX_Z; ++i) {
ret = sensor_hub_input_get_attribute_info(hsdev,
HID_INPUT_REPORT,
usage_id,
HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS + i,
&st->gyro[CHANNEL_SCAN_INDEX_X + i]);
if (ret < 0)
break;
gyro_3d_adjust_channel_bit_mask(channels,
CHANNEL_SCAN_INDEX_X + i,
st->gyro[CHANNEL_SCAN_INDEX_X + i].size);
}
dev_dbg(&pdev->dev, "gyro_3d %x:%x, %x:%x, %x:%x\n",
st->gyro[0].index,
st->gyro[0].report_id,
st->gyro[1].index, st->gyro[1].report_id,
st->gyro[2].index, st->gyro[2].report_id);
st->scale_precision = hid_sensor_format_scale(
HID_USAGE_SENSOR_GYRO_3D,
&st->gyro[CHANNEL_SCAN_INDEX_X],
&st->scale_pre_decml, &st->scale_post_decml);
/* Set Sensitivity field ids, when there is no individual modifier */
if (st->common_attributes.sensitivity.index < 0) {
sensor_hub_input_get_attribute_info(hsdev,
HID_FEATURE_REPORT, usage_id,
HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS |
HID_USAGE_SENSOR_DATA_ANGL_VELOCITY,
&st->common_attributes.sensitivity);
dev_dbg(&pdev->dev, "Sensitivity index:report %d:%d\n",
st->common_attributes.sensitivity.index,
st->common_attributes.sensitivity.report_id);
}
return ret;
} | [
"brenocfg@gmail.com"
] | brenocfg@gmail.com |
1730c68621c64a3f590c308facfe33c0fe46e92e | 976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f | /source/reactos/modules/rostests/winetests/kernel32/extr_locale.c_compare_string3.c | 6b43767d8dfa2ecab085837e3a286a66ab262b7e | [] | no_license | isabella232/AnghaBench | 7ba90823cf8c0dd25a803d1688500eec91d1cf4e | 9a5f60cdc907a0475090eef45e5be43392c25132 | refs/heads/master | 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,004 | c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ key2 ;
typedef int /*<<< orphan*/ key1 ;
/* Variables and functions */
int /*<<< orphan*/ LCMAP_SORTKEY ;
int /*<<< orphan*/ LCMapStringA (int /*<<< orphan*/ ,int /*<<< orphan*/ ,char const*,int,char*,int) ;
int strcmp (char*,char*) ;
__attribute__((used)) static int compare_string3(const void *e1, const void *e2)
{
const char *s1 = *(const char *const *)e1;
const char *s2 = *(const char *const *)e2;
char key1[256], key2[256];
LCMapStringA(0, LCMAP_SORTKEY, s1, -1, key1, sizeof(key1));
LCMapStringA(0, LCMAP_SORTKEY, s2, -1, key2, sizeof(key2));
return strcmp(key1, key2);
} | [
"brenocfg@gmail.com"
] | brenocfg@gmail.com |
0310432a27b19da1b8bacc48f339f9ef98232a1a | 5c255f911786e984286b1f7a4e6091a68419d049 | /code/37a26e04-8258-4f57-8e28-fa98fb6f4adb.c | 2b48186be110b4ba75050cb2803e5931498abac3 | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 217 | c | #include <stdio.h>
int main() {
int i=4;
int j=42;
int k;
int l;
k = 53;
l = 64;
k = i/j;
l = i%j;
l = j+j;
k = k-k*i;
printf("vulnerability");
printf("%d%d\n",k,l);
return 0;
}
| [
"nharmon8@gmail.com"
] | nharmon8@gmail.com |
b6ffcd9be472fd8445f83fd668f520278bf0aab4 | 57ea38c6181ebbef99f5f9076985a56840b9a55e | /lib/dev/bjt/bjtnoise.c | a1e1042ee6ebb780587c58eee5f6baf8541778fa | [
"MIT"
] | permissive | ResonanceGroup/SPICE | b4c92eab5cef58ed0d768044c0ee516030a9b8ee | 4ea3da2371bcf5d901fa7a6388382acf50f4a2fb | refs/heads/master | 2020-03-14T23:50:49.069010 | 2018-05-02T13:45:09 | 2018-05-02T13:45:09 | 131,854,435 | 0 | 1 | MIT | 2018-05-02T13:45:10 | 2018-05-02T13:27:11 | null | UTF-8 | C | false | false | 7,263 | c | /**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1987 Gary W. Ng
**********/
#include "spice.h"
#include <stdio.h>
#include "bjtdefs.h"
#include "cktdefs.h"
#include "fteconst.h"
#include "iferrmsg.h"
#include "noisedef.h"
#include "util.h"
#include "suffix.h"
/*
* BJTnoise (mode, operation, firstModel, ckt, data, OnDens)
*
* This routine names and evaluates all of the noise sources
* associated with BJT's. It starts with the model *firstModel and
* traverses all of its insts. It then proceeds to any other models
* on the linked list. The total output noise density generated by
* all of the BJT's is summed with the variable "OnDens".
*/
extern void NevalSrc();
extern double Nintegrate();
int
BJTnoise (mode, operation, genmodel, ckt, data, OnDens)
GENmodel *genmodel;
int mode;
int operation;
CKTcircuit *ckt;
register Ndata *data;
double *OnDens;
{
BJTmodel *firstModel = (BJTmodel *) genmodel;
register BJTmodel *model;
register BJTinstance *inst;
char name[N_MXVLNTH];
double tempOnoise;
double tempInoise;
double noizDens[BJTNSRCS];
double lnNdens[BJTNSRCS];
int error;
int i;
/* define the names of the noise sources */
static char *BJTnNames[BJTNSRCS] = { /* Note that we have to keep the order */
"_rc", /* noise due to rc */ /* consistent with the index definitions */
"_rb", /* noise due to rb */ /* in BJTdefs.h */
"_re", /* noise due to re */
"_ic", /* noise due to ic */
"_ib", /* noise due to ib */
"_1overf", /* flicker (1/f) noise */
"" /* total transistor noise */
};
for (model=firstModel; model != NULL; model=model->BJTnextModel) {
for (inst=model->BJTinstances; inst != NULL; inst=inst->BJTnextInstance) {
switch (operation) {
case N_OPEN:
/* see if we have to to produce a summary report */
/* if so, name all the noise generators */
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
switch (mode) {
case N_DENS:
for (i=0; i < BJTNSRCS; i++) {
(void)sprintf(name,"onoise_%s%s",
inst->BJTname,BJTnNames[i]);
data->namelist = (IFuid *)
trealloc((char *)data->namelist,
(data->numPlots + 1)*sizeof(IFuid));
if (!data->namelist) return(E_NOMEM);
(*(SPfrontEnd->IFnewUid))(ckt,
&(data->namelist[data->numPlots++]),
(IFuid)NULL,name,UID_OTHER,(GENERIC **)NULL);
/* we've added one more plot */
}
break;
case INT_NOIZ:
for (i=0; i < BJTNSRCS; i++) {
(void)sprintf(name,"onoise_total_%s%s",
inst->BJTname,BJTnNames[i]);
data->namelist = (IFuid *)
trealloc((char *)data->namelist,
(data->numPlots + 1)*sizeof(IFuid));
if (!data->namelist) return(E_NOMEM);
(*(SPfrontEnd->IFnewUid))(ckt,
&(data->namelist[data->numPlots++]),
(IFuid)NULL,name,UID_OTHER,(GENERIC **)NULL);
/* we've added one more plot */
(void)sprintf(name,"inoise_total_%s%s",
inst->BJTname,BJTnNames[i]);
data->namelist = (IFuid *)trealloc((char *)data->namelist,(data->numPlots + 1)*sizeof(IFuid));
if (!data->namelist) return(E_NOMEM);
(*(SPfrontEnd->IFnewUid))(ckt,
&(data->namelist[data->numPlots++]),
(IFuid)NULL,name,UID_OTHER,(GENERIC **)NULL);
/* we've added one more plot */
}
break;
}
}
break;
case N_CALC:
switch (mode) {
case N_DENS:
NevalSrc(&noizDens[BJTRCNOIZ],&lnNdens[BJTRCNOIZ],
ckt,THERMNOISE,inst->BJTcolPrimeNode,inst->BJTcolNode,
model->BJTcollectorConduct * inst->BJTarea);
NevalSrc(&noizDens[BJTRBNOIZ],&lnNdens[BJTRBNOIZ],
ckt,THERMNOISE,inst->BJTbasePrimeNode,inst->BJTbaseNode,
*(ckt->CKTstate0 + inst->BJTgx));
NevalSrc(&noizDens[BJT_RE_NOISE],&lnNdens[BJT_RE_NOISE],
ckt,THERMNOISE,inst->BJTemitPrimeNode,inst->BJTemitNode,
model->BJTemitterConduct * inst->BJTarea);
NevalSrc(&noizDens[BJTICNOIZ],&lnNdens[BJTICNOIZ],
ckt,SHOTNOISE,inst->BJTcolPrimeNode, inst->BJTemitPrimeNode,
*(ckt->CKTstate0 + inst->BJTcc));
NevalSrc(&noizDens[BJTIBNOIZ],&lnNdens[BJTIBNOIZ],
ckt,SHOTNOISE,inst->BJTbasePrimeNode, inst->BJTemitPrimeNode,
*(ckt->CKTstate0 + inst->BJTcb));
NevalSrc(&noizDens[BJTFLNOIZ],(double*)NULL,ckt,
N_GAIN,inst->BJTbasePrimeNode, inst->BJTemitPrimeNode,
(double)0.0);
noizDens[BJTFLNOIZ] *= model->BJTfNcoef *
exp(model->BJTfNexp *
log(MAX(FABS(*(ckt->CKTstate0 + inst->BJTcb)),N_MINLOG))) /
data->freq;
lnNdens[BJTFLNOIZ] =
log(MAX(noizDens[BJTFLNOIZ],N_MINLOG));
noizDens[BJTTOTNOIZ] = noizDens[BJTRCNOIZ] +
noizDens[BJTRBNOIZ] +
noizDens[BJT_RE_NOISE] +
noizDens[BJTICNOIZ] +
noizDens[BJTIBNOIZ] +
noizDens[BJTFLNOIZ];
lnNdens[BJTTOTNOIZ] =
log(noizDens[BJTTOTNOIZ]);
*OnDens += noizDens[BJTTOTNOIZ];
if (data->delFreq == 0.0) {
/* if we haven't done any previous integration, we need to */
/* initialize our "history" variables */
for (i=0; i < BJTNSRCS; i++) {
inst->BJTnVar[LNLSTDENS][i] = lnNdens[i];
}
/* clear out our integration variables if it's the first pass */
if (data->freq == ((NOISEAN*)ckt->CKTcurJob)->NstartFreq) {
for (i=0; i < BJTNSRCS; i++) {
inst->BJTnVar[OUTNOIZ][i] = 0.0;
inst->BJTnVar[INNOIZ][i] = 0.0;
}
}
} else { /* data->delFreq != 0.0 (we have to integrate) */
/* In order to get the best curve fit, we have to integrate each component separately */
for (i=0; i < BJTNSRCS; i++) {
if (i != BJTTOTNOIZ) {
tempOnoise = Nintegrate(noizDens[i], lnNdens[i],
inst->BJTnVar[LNLSTDENS][i], data);
tempInoise = Nintegrate(noizDens[i] * data->GainSqInv ,
lnNdens[i] + data->lnGainInv,
inst->BJTnVar[LNLSTDENS][i] + data->lnGainInv,
data);
inst->BJTnVar[LNLSTDENS][i] = lnNdens[i];
data->outNoiz += tempOnoise;
data->inNoise += tempInoise;
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
inst->BJTnVar[OUTNOIZ][i] += tempOnoise;
inst->BJTnVar[OUTNOIZ][BJTTOTNOIZ] += tempOnoise;
inst->BJTnVar[INNOIZ][i] += tempInoise;
inst->BJTnVar[INNOIZ][BJTTOTNOIZ] += tempInoise;
}
}
}
}
if (data->prtSummary) {
for (i=0; i < BJTNSRCS; i++) { /* print a summary report */
data->outpVector[data->outNumber++] = noizDens[i];
}
}
break;
case INT_NOIZ: /* already calculated, just output */
if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0) {
for (i=0; i < BJTNSRCS; i++) {
data->outpVector[data->outNumber++] = inst->BJTnVar[OUTNOIZ][i];
data->outpVector[data->outNumber++] = inst->BJTnVar[INNOIZ][i];
}
} /* if */
break;
} /* switch (mode) */
break;
case N_CLOSE:
return (OK); /* do nothing, the main calling routine will close */
break; /* the plots */
} /* switch (operation) */
} /* for inst */
} /* for model */
return(OK);
}
| [
"=phillipmobley2@gmail.com"
] | =phillipmobley2@gmail.com |
0e86a05e4e6843d27a152ee3c518eb30039339ad | 53170056ca2a6cfaf465ec852767a4336a287ea5 | /C/4.p.4.c | dbe2e9f2209a0f37ea1080bf1d30df1152438cd8 | [] | no_license | zoffixznet/c-practice | c0f5248404beb2df48aacf47e4568e3ab768cf92 | f9b0083a930d88269aba564cdfa233c74615ada1 | refs/heads/master | 2021-05-23T05:44:54.736772 | 2018-04-16T01:25:18 | 2018-04-16T01:25:18 | 94,892,781 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 186 | c | #include <stdio.h>
int main(void)
{
int i;
printf("Enter a number between 0 and 32767: ");
scanf("%d", &i);
printf("The number in octal is: %05o\n", i);
return 0;
}
| [
"cpan@zoffix.com"
] | cpan@zoffix.com |
2d0655ed1e4a9a2a294f3c14796c6b97762dbfbd | ec9584191115d83387a36432206e3a1a2237bedf | /dhonffy/week-06/day-02/computer/main.c | 2954b3ac4fa6e7d89ff95a27acdb60e1fc160fe8 | [] | no_license | green-fox-academy/dhonffy | e7fcbc32ac535da5e6649f51dfdad69b0eb287b9 | a789649deda3369b1742345876e22d4b8cf52b57 | refs/heads/master | 2020-06-11T08:53:40.671520 | 2019-09-21T04:44:43 | 2019-09-21T04:44:43 | 193,908,303 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,095 | c | #include <stdio.h>
#include <stdint.h>
// Use the computer struct, give values to the fields and print them out in the main!
// Use the Notebook struct, give values to the fields and print them out in the main!
struct computer {
float cpu_speed_GHz;
int ram_size_GB;
int bits;
};
typedef struct notebook{
float cpu_speed_GHz;
int ram_size_GB;
int bits;
} notebook_t;
int main()
{
struct computer computer;
computer.cpu_speed_GHz = 1.2;
computer.ram_size_GB = 8;
computer.bits = 64;
printf("Computer CPU speed %f GHz, RAM size %d GB, %d bits\n", computer.cpu_speed_GHz, computer.ram_size_GB,
computer.bits);
notebook_t notebook;
notebook.cpu_speed_GHz = 2.1;
notebook.ram_size_GB = 16;
notebook.bits = 32;
printf("Notebook CPU speed %f GHz, RAM size %d GB, %d bits\n", notebook.cpu_speed_GHz, notebook.ram_size_GB,
notebook.bits);
return 0;
} | [
"honffy.daniel@gmail.com"
] | honffy.daniel@gmail.com |
416ffbc973d0d20e03e5b3224773a4d8621b7bec | 97660e2b7be9733a66f2f46555136474e91729d4 | /SW2812 五彩灯程序/SW2812/UserSource/SystemState.h | 6ab6d8cb2042716554776e4e31d7ebd1407ce020 | [] | no_license | xiejia31/Robomaster2018 | 2f6fa6fc223b546f81aa6aa07895f0d1573e48e2 | 9e38f787e14785b58d0793435fae66330f4a6886 | refs/heads/master | 2023-03-15T23:41:24.139284 | 2018-08-11T03:09:25 | 2018-08-11T03:09:25 | null | 0 | 0 | null | null | null | null | GB18030 | C | false | false | 1,367 | h | #ifndef __SysState_H__
#define __SysState_H__
#include "stm32f1xx_hal.h"
#include "tim.h"
#include "MyCom.h"
//===============================================================系统模式定义
#define SetSystemState(x) SystemState.State=SystemState.State|x //设置系统状态
#define ClearSystemState(x) SystemState.State=SystemState.State&(~x) //清除系统状态
#define GetSystemState(x) (SystemState.State&x)//获取系统状态
//==============================================================电机堵转定义
#define OutLine_Time 50 //断线检测时间
typedef enum
{
Beep_Silence, //沉默
Beep_Beeping, //长鸣
}BEEPMode;
typedef struct{
short Mode;//运行模式
short Enable;//状态
short State;//状态
short Task;//任务
int Time;//System run time mm
TIM_HandleTypeDef *htim;//时间计数器句柄
long OutLine_Flag;//断线标志
}SystemStateDef;
typedef enum
{
MainCtr_Heart,
DeviceTotal_No
}DeviceX_NoDEF;
extern SystemStateDef SystemState;
int SystemState_Inite(void);//SystemState初始化
inline void RefreshSysTime(void);//刷新系统时间(mm)
float GetSystemTimer(void);//获取系统当前准确时间
void MesureTimePeriod(void);//测量运行间隔
void RefreshDeviceOutLineTime(DeviceX_NoDEF DevX_No);//刷新外设通信时间时间数组
void OutLine_Check(void);//断线检测检测
#endif
| [
"houhongyi@qq.com"
] | houhongyi@qq.com |
2ce7293b5eee5e0c2affd5810d510bee3c497f59 | d8e2095e3990897140e31796a53c50ba4a960017 | /plugins/lb-plugin/lb/api.c | 56806d25d0cacd9c7f34b7ecf0232fd127251ac3 | [
"Apache-2.0"
] | permissive | aiyi/vpp | afcbca39c56440acc5fbaf6c4ecc7e83289c90f5 | 3a4ed3934585eb841fa36f6f062adf4dce9b4661 | refs/heads/master | 2020-12-24T09:53:47.969438 | 2016-11-08T12:20:42 | 2016-11-08T19:29:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 6,752 | c | /*
* Copyright (c) 2016 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <lb/lb.h>
#include <vppinfra/byte_order.h>
#include <vlibapi/api.h>
#include <vlibapi/api.h>
#include <vlibmemory/api.h>
#include <vlibsocket/api.h>
#define vl_msg_id(n,h) n,
typedef enum {
#include <lb/lb.api.h>
/* We'll want to know how many messages IDs we need... */
VL_MSG_FIRST_AVAILABLE,
} vl_msg_id_t;
#undef vl_msg_id
/* define message structures */
#define vl_typedefs
#include <lb/lb.api.h>
#undef vl_typedefs
/* define generated endian-swappers */
#define vl_endianfun
#include <lb/lb.api.h>
#undef vl_endianfun
#define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
/* Get the API version number */
#define vl_api_version(n,v) static u32 api_version=(v);
#include <lb/lb.api.h>
#undef vl_api_version
/* Macro to finish up custom dump fns */
#define FINISH \
vec_add1 (s, 0); \
vl_print (handle, (char *)s); \
vec_free (s); \
return handle;
/*
* A handy macro to set up a message reply.
* Assumes that the following variables are available:
* mp - pointer to request message
* rmp - pointer to reply message type
* rv - return value
*/
#define REPLY_MACRO(t) \
do { \
unix_shared_memory_queue_t * q = \
vl_api_client_index_to_input_queue (mp->client_index); \
if (!q) \
return; \
\
rmp = vl_msg_api_alloc (sizeof (*rmp)); \
rmp->_vl_msg_id = ntohs((t)+lbm->msg_id_base); \
rmp->context = mp->context; \
rmp->retval = ntohl(rv); \
\
vl_msg_api_send_shmem (q, (u8 *)&rmp); \
} while(0);
static void
vl_api_lb_conf_t_handler
(vl_api_lb_conf_t * mp)
{
lb_main_t *lbm = &lb_main;
vl_api_lb_conf_reply_t * rmp;
int rv = 0;
rv = lb_conf((ip4_address_t *)&mp->ip4_src_address,
(ip6_address_t *)mp->ip6_src_address,
mp->sticky_buckets_per_core,
mp->flow_timeout);
REPLY_MACRO (VL_API_LB_CONF_REPLY);
}
static void *vl_api_lb_conf_t_print
(vl_api_lb_conf_t *mp, void * handle)
{
u8 * s;
s = format (0, "SCRIPT: lb_conf ");
s = format (s, "%U ", format_ip4_address, (ip4_address_t *)&mp->ip4_src_address);
s = format (s, "%U ", format_ip6_address, (ip6_address_t *)mp->ip6_src_address);
s = format (s, "%u ", mp->sticky_buckets_per_core);
s = format (s, "%u ", mp->flow_timeout);
FINISH;
}
static void
vl_api_lb_add_del_vip_t_handler
(vl_api_lb_add_del_vip_t * mp)
{
lb_main_t *lbm = &lb_main;
vl_api_lb_conf_reply_t * rmp;
int rv = 0;
ip46_address_t prefix;
memcpy(&prefix.ip6, mp->ip_prefix, sizeof(prefix.ip6));
if (mp->is_del) {
u32 vip_index;
if (!(rv = lb_vip_find_index(&prefix, mp->prefix_length, &vip_index)))
rv = lb_vip_del(vip_index);
} else {
u32 vip_index;
lb_vip_type_t type;
if (ip46_prefix_is_ip4(&prefix, mp->prefix_length)) {
type = mp->is_gre4?LB_VIP_TYPE_IP4_GRE4:LB_VIP_TYPE_IP4_GRE6;
} else {
type = mp->is_gre4?LB_VIP_TYPE_IP6_GRE4:LB_VIP_TYPE_IP6_GRE6;
}
rv = lb_vip_add(&prefix, mp->prefix_length, type,
mp->new_flows_table_length, &vip_index);
}
REPLY_MACRO (VL_API_LB_CONF_REPLY);
}
static void *vl_api_lb_add_del_vip_t_print
(vl_api_lb_add_del_vip_t *mp, void * handle)
{
u8 * s;
s = format (0, "SCRIPT: lb_add_del_vip ");
s = format (s, "%U ", format_ip46_prefix,
(ip46_address_t *)mp->ip_prefix, mp->prefix_length, IP46_TYPE_ANY);
s = format (s, "%s ", mp->is_gre4?"gre4":"gre6");
s = format (s, "%u ", mp->new_flows_table_length);
s = format (s, "%s ", mp->is_del?"del":"add");
FINISH;
}
static void
vl_api_lb_add_del_as_t_handler
(vl_api_lb_add_del_as_t * mp)
{
lb_main_t *lbm = &lb_main;
vl_api_lb_conf_reply_t * rmp;
int rv = 0;
u32 vip_index;
if ((rv = lb_vip_find_index((ip46_address_t *)mp->vip_ip_prefix,
mp->vip_prefix_length, &vip_index)))
goto done;
if (mp->is_del)
rv = lb_vip_del_ass(vip_index, (ip46_address_t *)mp->as_address, 1);
else
rv = lb_vip_add_ass(vip_index, (ip46_address_t *)mp->as_address, 1);
done:
REPLY_MACRO (VL_API_LB_CONF_REPLY);
}
static void *vl_api_lb_add_del_as_t_print
(vl_api_lb_add_del_as_t *mp, void * handle)
{
u8 * s;
s = format (0, "SCRIPT: lb_add_del_as ");
s = format (s, "%U ", format_ip46_prefix,
(ip46_address_t *)mp->vip_ip_prefix, mp->vip_prefix_length, IP46_TYPE_ANY);
s = format (s, "%U ", format_ip46_address,
(ip46_address_t *)mp->as_address, IP46_TYPE_ANY);
s = format (s, "%s ", mp->is_del?"del":"add");
FINISH;
}
/* List of message types that this plugin understands */
#define foreach_lb_plugin_api_msg \
_(LB_CONF, lb_conf) \
_(LB_ADD_DEL_VIP, lb_add_del_vip) \
_(LB_ADD_DEL_AS, lb_add_del_as)
static clib_error_t * lb_api_init (vlib_main_t * vm)
{
lb_main_t *lbm = &lb_main;
u8 *name = format (0, "lb_%08x%c", api_version, 0);
lbm->msg_id_base = vl_msg_api_get_msg_ids
((char *) name, VL_MSG_FIRST_AVAILABLE);
#define _(N,n) \
vl_msg_api_set_handlers((VL_API_##N + lbm->msg_id_base), \
#n, \
vl_api_##n##_t_handler, \
vl_noop_handler, \
vl_api_##n##_t_endian, \
vl_api_##n##_t_print, \
sizeof(vl_api_##n##_t), 1);
foreach_lb_plugin_api_msg;
#undef _
return 0;
}
VLIB_INIT_FUNCTION (lb_api_init);
| [
"openvpp@barachs.net"
] | openvpp@barachs.net |
96439b8e441a31870ec375b9bc910751122f6682 | bca198a06ba2325f365c2086e1c98f1ffdff2461 | /lufa/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.c | 10fcb3769620429578f9d8830b44186f84625919 | [
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | JonD07/Zumo-Delivery | 268c302e80490a2a59cc2275ad4b555de51b1b63 | f22f9b27318a3eb7221a86f7273ec66479c7b14c | refs/heads/master | 2023-04-23T16:45:14.359530 | 2021-04-29T16:48:36 | 2021-04-29T16:48:36 | 360,696,606 | 0 | 0 | MIT | 2021-04-29T16:46:15 | 2021-04-22T22:22:25 | C | UTF-8 | C | false | false | 2,841 | c | /*
LUFA Library
Copyright (C) Dean Camera, 2020.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2020 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaims all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
*
* Main source file for the MouseHostDevice demo. This file contains the main tasks of
* the demo and is responsible for the overall control flow of the demo.
*/
#include "MouseHostDevice.h"
/** Main program entry point. This routine configures the hardware required by the application, then
* enters a loop to run the application tasks in sequence.
*/
int main(void)
{
SetupHardware();
puts_P(PSTR(ESC_FG_CYAN "Mouse Host/Device Demo running.\r\n" ESC_FG_WHITE));
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
GlobalInterruptEnable();
for (;;)
{
/* Determine which USB mode we are currently in */
if (USB_CurrentMode == USB_MODE_Host)
{
MouseHost_Task();
HID_Host_USBTask(&Mouse_HID_Host_Interface);
}
else
{
HID_Device_USBTask(&Mouse_HID_Device_Interface);
}
USB_USBTask();
}
}
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */
Serial_Init(9600, false);
LEDs_Init();
Joystick_Init();
Buttons_Init();
USB_Init(USB_MODE_UID);
/* Create a stdio stream for the serial port for stdin and stdout */
Serial_CreateStream(NULL);
}
/** Event handler for the library USB mode change event. */
void EVENT_USB_UIDChange(void)
{
printf_P(PSTR(ESC_FG_YELLOW "UID Change to %S mode\r\n" ESC_FG_WHITE),
(USB_CurrentMode == USB_MODE_Device) ? PSTR("Device") : PSTR("Host"));
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
}
| [
"jonathan.a.diller@gmail.com"
] | jonathan.a.diller@gmail.com |
6338d4d93f35b2b4732fc54bc48a0fcd2cd26d93 | d8e1a65a5863ea5a111c8304a040f1c797f8ebbf | / mtktest --username qq413187589/N65/N65_V1/plutommi/mmi/GSMCallApplication/CommonFiles/CommonInc/CmErrorHandlersProtEX.h | 360ac4322c3464105c7fe78fc719115d4980d154 | [] | no_license | manoj-gupta5/mtktest | a6b627cde8c9a543d473a99f778fd6f587a8d053 | 98370766a36fffb8b0dde1cc6dd144599ea184f6 | refs/heads/master | 2020-12-25T21:12:59.596045 | 2010-07-18T05:06:14 | 2010-07-18T05:06:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,141 | h | /*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*******************************************************************************
* Filename:
* ---------
* CmErrorHandlersProt.h
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
*
*
* Author:
* -------
*
*
*==============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*==============================================================================
*******************************************************************************/
/**
* Copyright Notice
* ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
* Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
* (It is illegal to remove this copyright notice from this software or any
* portion of it)
*/
/**************************************************************
FILENAME : CmErrorHandlersProt.h
PURPOSE : Call Management error handlers prototypes
REMARKS : nil
AUTHOR : Gupta Ashish
DATE : Apr 07, 03
**************************************************************/
#ifdef __MMI_UCM__
#ifndef _CMERRORHANDLER_PROT_H
#define _CMERRORHANDLER_PROT_H
extern void ProcessIncomingFailureEvents(CM_EVENT_TYPES event, U16 cause);
extern void OutgoingProcessCMFailureEvent(CM_EVENT_TYPES inEvenType, U16 cause);
extern void ProcessPSCallConnectFailEvent(U16 cause);
extern void ShowCallManagementErrorMessage(U16 cause, U8 op_code);
extern void ExitScrCMErrMsg(void);
#endif /* _CMERRORHANDLER_PROT_H */
#endif /* __MMI_UCM__ */
| [
"qq413187589@046de88f-2cd9-6c0a-3028-073e08bc931c"
] | qq413187589@046de88f-2cd9-6c0a-3028-073e08bc931c |
4e31185c40a687e1154077f47ab2050f83d80d46 | c8639e2b4bb7116d7dd66acaa769c30d7bb479f7 | /world/d/pansi/mishi1.c | e588b59a9607c5b4605cf33d70d7f202c5d49be2 | [] | no_license | ninemoon/mhxy2002 | 43bc9759bbde56e2c49c524514f3dc4f83fbe932 | 76e0fa31cd662864bd55168e2fdf986622ed510e | refs/heads/master | 2021-09-06T10:05:19.812948 | 2018-02-05T09:57:57 | 2018-02-05T09:57:57 | 120,064,608 | 0 | 0 | null | 2018-02-03T06:07:09 | 2018-02-03T06:07:08 | null | GB18030 | C | false | false | 310 | c | // Room: /u/rainy/sea/mishi1.c inherit ROOM;
inherit ROOM;
void create()
{
set ("short", "密室");
set ("long", @LONG
密室中黑黑的,看不大清楚。
LONG);
set("objects", ([ /* sizeof() == 1 */
__DIR__"npc/kao" : 1,
]));
set("no_clean_up", 0);
setup();
}
| [
"liming.xie@gmail.com"
] | liming.xie@gmail.com |
cfdabbd8c3d3576cbd87a9c9c4b0383a6c96a03d | 42ac815d273231cce9a2ba92dd80f9edafbc9003 | /dragonfly/dragonfly.h | 7e2ed5c7fc707f86b62ed4f7aa293cf762f7424a | [] | no_license | laprej/ROSS-Models | 3fcef2b96d00fe2333331fab83bae81e11873d03 | 1c13179fa02f502e92d769bc5d65d16bc8f1afac | refs/heads/master | 2021-01-15T16:57:55.711226 | 2016-07-15T22:59:14 | 2016-07-15T22:59:14 | 62,649,254 | 1 | 0 | null | 2016-07-05T15:43:53 | 2016-07-05T15:43:52 | null | UTF-8 | C | false | false | 5,697 | h | #ifndef INC_dragonfly_h
#define INC_dragonfly_h
#include <ross.h>
// dragonfly basic configuration parameters
#define GLOBAL_CHANNELS 4
#define NUM_ROUTER 8
#define NUM_TERMINALS 4
#define MESSAGE_SIZE 512.0
#define PACKET_SIZE 512.0
#define CHUNK_SIZE 32.0
// delay parameters
//#define TERMINAL_DELAY 1.0
//#define LOCAL_DELAY 1.0
//#define GLOBAL_DELAY 10.0
#define GLOBAL_BANDWIDTH 4.7
#define LOCAL_BANDWIDTH 5.25
#define NODE_BANDWIDTH 5.25
#define CREDIT_SIZE 8
#define INJECTION_INTERVAL 3000
//16-05
#define RESCHEDULE_DELAY 1.0
// time to process a packet at destination terminal
#define MEAN_PROCESS 1.0
#define NUM_VC 1
#define N_COLLECT_POINTS 100
// virtual channel information
#define LOCAL_VC_SIZE 32768
#define TERMINAL_THRESHOLD 256
#define ROUTER_THRESHOLD 256
#define GLOBAL_VC_SIZE 65536
#define TERMINAL_VC_SIZE 16384
// radix of each router
#define RADIX (NUM_VC * NUM_ROUTER)+ (NUM_VC*GLOBAL_CHANNELS) + (NUM_VC * NUM_TERMINALS)
// debugging parameters
#define DEBUG 1
#define TRACK 601
#define PRINT_ROUTER_TABLE 1
#define NUM_ROWS NUM_ROUTER*NUM_TERMINALS
#define NUM_COLS (NUM_ROUTER*NUM_TERMINALS)+1
#define TERMINAL_WAITING_PACK_COUNT 1 << 16
#define ROUTER_WAITING_PACK_COUNT 1 << 18
extern FILE *dragonfly_event_log;
// arrival rate
static double MEAN_INTERVAL=200.0;
typedef enum event_t event_t;
typedef struct terminal_state terminal_state;
typedef struct terminal_message terminal_message;
typedef struct buf_space_message buf_space_message;
typedef struct router_state router_state;
typedef struct waiting_packet waiting_packet;
typedef struct process_state process_state;
struct terminal_state
{
// Dragonfly specific parameters
unsigned int router_id;
unsigned int terminal_id;
// Each terminal will have an input and output channel with the router
int vc_occupancy[NUM_VC];
int output_vc_state[NUM_VC];
tw_stime terminal_available_time;
tw_stime next_credit_available_time;
//first element of linked list
struct waiting_packet * waiting_list;
// pointer to the linked list
struct waiting_packet * head;
int wait_count;
int packet_counter;
// Terminal generate, sends and arrival T_SEND, T_ARRIVAL, T_GENERATE
// Router-Router Intra-group sends and receives RR_LSEND, RR_LARRIVE
// Router-Router Inter-group sends and receives RR_GSEND, RR_GARRIVE
};
enum event_t
{
RESCHEDULE,
T_GENERATE,
T_ARRIVE,
T_SEND,
R_SEND,
R_ARRIVE,
BUFFER,
WAIT,
FINISH,
MPI_SEND,
MPI_RECV
};
enum vc_status
{
VC_IDLE,
VC_ACTIVE,
VC_ALLOC,
VC_CREDIT
};
enum last_hop
{
GLOBAL,
LOCAL,
TERMINAL
};
enum ROUTING_ALGO
{
MINIMAL,
NON_MINIMAL,
ADAPTIVE
};
enum TRAFFIC_PATTERN
{
UNIFORM_RANDOM=1,
WORST_CASE,
TRANSPOSE,
NEAREST_NEIGHBOR,
BISECTION,
NEAREST_ROUTER
};
struct terminal_message
{
tw_stime travel_start_time;
unsigned long long packet_ID;
event_t type;
unsigned int dest_terminal_id;
unsigned int src_terminal_id;
short my_N_hop;
// Intermediate LP ID from which this message is coming
unsigned int intm_lp_id;
short old_vc;
short saved_vc;
short last_hop;
// For buffer message
short vc_index;
int input_chan;
int output_chan;
tw_stime saved_available_time;
tw_stime saved_credit_time;
int intm_group_id;
short wait_type;
short wait_loc;
short chunk_id;
// short route;
};
struct router_state
{
unsigned int router_id;
unsigned int group_id;
int global_channel[GLOBAL_CHANNELS];
// 0--NUM_ROUTER-1 local router indices (router-router intragroup channels)
// NUM_ROUTER -- NUM_ROUTER+GLOBAL_CHANNELS-1 global channel indices (router-router inter-group channels)
// NUM_ROUTER+GLOBAL_CHANNELS -- RADIX-1 terminal indices (router-terminal channels)
tw_stime next_output_available_time[RADIX];
// tw_stime next_input_available_time[RADIX];
// tw_stime next_available_time;
tw_stime next_credit_available_time[RADIX];
// tw_stime next_credit_available_time[RADIX];
// unsigned int credit_occupancy[RADIX];
int vc_occupancy[RADIX];
// unsigned int input_vc_state[RADIX];
unsigned int output_vc_state[RADIX];
//first element of linked list
struct waiting_packet * waiting_list;
// pointer to the linked list
struct waiting_packet * head;
int wait_count;
};
struct process_state
{
int message_counter;
tw_stime available_time;
unsigned int router_id;
unsigned int group_id;
// For matrix transpose traffic
int row, col;
};
struct waiting_packet
{
terminal_message * packet;
struct waiting_packet * next;
int chan;
};
static int nlp_terminal_per_pe;
static int nlp_router_per_pe;
static int nlp_mpi_procs_per_pe;
static int opt_mem = 10000;
static int mem_factor = 32;
static int max_packets = 0;
static int ROUTING= MINIMAL;
static int traffic= NEAREST_NEIGHBOR;
int minimal_count, nonmin_count;
int adaptive_threshold;
int head_delay;
int num_packets;
int num_chunks;
int packet_offset;
tw_stime average_travel_time = 0;
tw_stime total_time = 0;
tw_stime max_latency = 0;
int range_start;
int num_vc;
int terminal_rem=0, router_rem=0;
int num_terminal=0, num_router=0;
unsigned long num_groups = NUM_ROUTER*GLOBAL_CHANNELS+1;
int total_routers, total_terminals, total_mpi_procs;
unsigned long long max_packet;
static unsigned long long total_hops = 0;
static unsigned long long N_finished = 0;
static unsigned long long N_finished_storage[N_COLLECT_POINTS];
static unsigned long long N_generated_storage[N_COLLECT_POINTS];
void dragonfly_mapping(void);
tw_lp * dragonfly_mapping_to_lp(tw_lpid lpid);
#endif
| [
"me@gonsie.com"
] | me@gonsie.com |
bd94171b3f5f8bc609b15b0a96cb29f0f325ea17 | e0c8cd8376c5dff35a62a7f7f1ab80fbe7ec8bd4 | /src/sntp.c | baaaf509b4fd0082ba6d3decb9f9e366da9cf936 | [
"MIT"
] | permissive | duckinator/sntp-client | a90da061ca1ddea282a1aed2209003b727c4e553 | 18250aad907fdec19ace982e08b383d8763a673c | refs/heads/main | 2023-03-03T23:54:15.295424 | 2021-02-22T08:59:31 | 2021-02-22T08:59:31 | 341,137,191 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 6,353 | c | #include <arpa/inet.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "socket.h"
#include "sntp.h"
// The delta is negative, so be sure to invert any operations on it.
static uint32_t NTP_TIMESTAMP_DELTA = 2208988800;
static uint8_t SNTP_CLIENT_MODE = 3;
static uint8_t SNTP_VERSION = 4 << 3;
uint64_t _htonll(uint64_t n) {
uint32_t *bytes = (uint32_t*)&n;
bytes[0] = htonl(bytes[0]);
bytes[1] = htonl(bytes[1]);
return *(uint64_t*)bytes;
}
uint64_t _ntohll(uint64_t n) {
uint32_t *bytes = (uint32_t*)&n;
bytes[0] = ntohl(bytes[0]);
bytes[1] = ntohl(bytes[1]);
return *(uint64_t*)bytes;
}
void verify_or_exit(NtpPacket *request, NtpPacket *response) {
static uint8_t LI_MASK = 3; // 0b00000011
//static uint8_t VN_MASK = 28; // 0b00011100
static uint8_t MODE_MASK = 7; // 0b00000111
static uint8_t VERSION_MASK = 56; // 0b00111000
if (request->tx_timestamp != response->origin_timestamp) {
fprintf(stderr, "sntp: Server gave invalid origin timestamp\n");
exit(EXIT_FAILURE);
}
uint8_t mode = (response->li_vn_mode & MODE_MASK);
uint8_t li = (response->li_vn_mode & LI_MASK) >> 6;
uint8_t response_version = (response->li_vn_mode & VERSION_MASK) >> 3;
uint8_t request_version = (request->li_vn_mode & VERSION_MASK) >> 3;
// LI Meaning
// ----------------------------------------------
// 0 No warning
// 1 Last minute has 61 seconds
// 2 Last minute has 59 seconds
// 3 Alarm condition (clock not synchronized)
if (li == 3) {
fprintf(stderr, "sntp: Server clock not synchronized\n");
exit(EXIT_FAILURE);
}
if (li > 3) {
fprintf(stderr, "sntp: Server gave invalid Leap Indicator value (expected 0-3, got %u)\n", li);
exit(EXIT_FAILURE);
}
// Mode Meaning
// ----------------------------
// 0 Reserved
// 1 Symmetric active
// 2 Symmetric passive
// 3 Client
// 4 Server
// 5 Broadcast
// 6 Reserved for NTP control message
// 7 Reserved for private use
if (mode != 4 && mode != 5) {
fprintf(stderr, "sntp: SNTP server gave invalid MODE (%u)\n", mode);
exit(EXIT_FAILURE);
}
if (response_version != request_version) {
fprintf(stderr, "sntp: (S)NTP version mismatch: %u (client) != %u (server)\n", request_version, response_version);
exit(EXIT_FAILURE);
}
if (response->stratum == 0) {
fprintf(stderr, "sntp: STRATUM should not be zero\n");
exit(EXIT_FAILURE);
}
}
void calculate_delay(NtpTimestamp *delay, NtpTimestamp *offset,
NtpPacket *response, uint64_t recv_timestamp) {
// Time request is sent by client.
uint64_t t1 = response->origin_timestamp;
// Time request received by server.
uint64_t t2 = response->recv_timestamp;
// Time reply sent by server.
uint64_t t3 = response->tx_timestamp;
// Time reply received by client
uint64_t t4 = recv_timestamp;
uint64_t delay_raw = (t4 - t1) - (t3 - t2);
uint64_t offset_raw = ((t2 - t1) + (t4 - t3)) / 2;
NtpTimestamp *delay_ts = (NtpTimestamp*)&delay_raw;
NtpTimestamp *offset_ts = (NtpTimestamp*)&offset_raw;
delay->seconds = delay_ts->seconds;
delay->seconds_fraction = delay_ts->seconds_fraction;
offset->seconds = offset_ts->seconds;
offset->seconds_fraction = offset_ts->seconds_fraction;
}
uint64_t ntp_time() {
return (uint64_t)time(NULL) + NTP_TIMESTAMP_DELTA;
}
uint32_t ntp_to_unix_time(uint32_t ntp) {
return ntp - NTP_TIMESTAMP_DELTA;
}
void correct_endianness(NtpPacket *packet) {
//uint8_t li_vn_mode;
//uint8_t stratum;
//uint8_t poll;
//uint8_t precision;
packet->root_delay = ntohl(packet->root_delay);
packet->root_dispersion = ntohl(packet->root_dispersion);
packet->ref_id = ntohl(packet->ref_id);
packet->ref_timestamp = _ntohll(packet->ref_timestamp);
packet->origin_timestamp = _ntohll(packet->origin_timestamp);
packet->recv_timestamp = _ntohll(packet->recv_timestamp);
packet->tx_timestamp = _ntohll(packet->tx_timestamp);
}
void sntp_request(NtpResult *result, int debug, const char *server, char *port) {
NtpPacket request = {
.li_vn_mode=SNTP_CLIENT_MODE | SNTP_VERSION,
.tx_timestamp=_htonll(ntp_time()),
};
NtpPacket response = {0};
int sock = socket_create(server, port);
if (debug) {
fprintf(stderr, "Connected to %s on port %s.\n", server, port);
}
socket_write(sock, &request, sizeof(NtpPacket));
socket_read(sock, &response, sizeof(NtpPacket));
correct_endianness(&request);
correct_endianness(&response);
if (debug) {
fprintf(stderr, "li_vn_mode = %u\n", response.li_vn_mode);
fprintf(stderr, "stratum = %u\n", response.stratum);
fprintf(stderr, "poll = %u\n", response.poll);
fprintf(stderr, "root_delay = %u\n", response.root_delay);
fprintf(stderr, "root_dispersion = %u\n", response.root_dispersion);
fprintf(stderr, "ref_id = %u\n", response.ref_id);
fprintf(stderr, "ref_timestamp = %lu\n", response.ref_timestamp);
fprintf(stderr, "origin_timestamp = %lu\n", response.origin_timestamp);
fprintf(stderr, "recv_timestamp = %lu\n", response.recv_timestamp);
fprintf(stderr, "tx_timestamp = %lu\n", response.tx_timestamp);
}
uint64_t receive_time = ntp_time();
verify_or_exit(&request, &response);
NtpTimestamp delay, offset;
calculate_delay(&delay, &offset, &response, receive_time);
NtpTimestamp *timestamp = (NtpTimestamp*)&response.tx_timestamp;
timestamp->seconds = ntp_to_unix_time(timestamp->seconds);
if (debug) {
fprintf(stderr, "timestamp: %u.%u\n", timestamp->seconds, timestamp->seconds_fraction);
fprintf(stderr, "delay = %u.%u\n", delay.seconds, delay.seconds_fraction);
fprintf(stderr, "offset = %u.%u\n", offset.seconds, offset.seconds_fraction);
}
memcpy((void*)&result->timestamp, timestamp, sizeof(NtpTimestamp));
memcpy((void*)&result->delay, &delay, sizeof(NtpTimestamp));
memcpy((void*)&result->offset, &offset, sizeof(NtpTimestamp));
}
| [
"me@duckie.co"
] | me@duckie.co |
f485fa389db7007e65a1d2346d6581c772af1a70 | 137f4b7359057eefda377ca69a87a6d0bf867590 | /demos/intrepid/neoobd2_pro/ble/nrf5_sdk/components/drivers_nrf/nrf_soc_nosd/nrf_soc.h | aaa6803052f8c25386279015a9700391da0fcde6 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | ghsecuritylab/neoobd2_sdk | ad27c521f319187de7f5393761c7c185a0d5e47c | e13c7b1bff7979903635aa22082c21e0547d1a41 | refs/heads/master | 2021-02-27T13:23:47.990944 | 2019-10-30T13:11:39 | 2019-10-30T13:11:39 | 245,608,691 | 0 | 0 | BSD-2-Clause | 2020-03-07T10:03:17 | 2020-03-07T10:03:16 | null | UTF-8 | C | false | false | 3,532 | h | /**
* Copyright (c) 2014 - 2019, Nordic Semiconductor ASA
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, 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 Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* 4. This software, with or without modification, must only be used with a
* Nordic Semiconductor ASA integrated circuit.
*
* 5. Any software provided in binary form under this license must not be reverse
* engineered, decompiled, modified and/or disassembled.
*
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA 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 NRF_SOC_H__
#define NRF_SOC_H__
#include <stdint.h>
#include "nrf.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@brief Waits for an application event.
*
* An application event is either an application interrupt or a pended interrupt when the
* interrupt is disabled. When the interrupt is enabled it will be taken immediately since
* this function will wait in thread mode, then the execution will return in the application's
* main thread. When an interrupt is disabled and gets pended it will return to the application's
* thread main. The application must ensure that the pended flag is cleared using
* ::sd_nvic_ClearPendingIRQ in order to sleep using this function. This is only necessary for
* disabled interrupts, as the interrupt handler will clear the pending flag automatically for
* enabled interrupts.
*
* In order to wake up from disabled interrupts, the SEVONPEND flag has to be set in the Cortex-M0
* System Control Register (SCR). @sa CMSIS_SCB
*
* @note If an application interrupt has happened since the last time sd_app_evt_wait was
* called this function will return immediately and not go to sleep. This is to avoid race
* conditions that can occur when a flag is updated in the interrupt handler and processed
* in the main loop.
*
* @post An application interrupt has happened or a interrupt pending flag is set.
*
* @retval ::NRF_SUCCESS
*/
uint32_t sd_app_evt_wait(void);
#ifdef __cplusplus
}
#endif
#endif /* NRF_SOC_H__ */
| [
"jchung@intrepidcs.com"
] | jchung@intrepidcs.com |
53e12b35ee10387fe89b121e84be79b813fc0b23 | b1affca7ab69fca4b41ee75ffcbb2fffe15bc294 | /demos/demo_treap/demo_treap.c | dd9834f3685f8c1bb265dbddb1f21ec6b23375ce | [] | no_license | jgthomas/data-structures-and-algorithms | d91b083a0f95dbe69db93b48dd6b6bcb80162ccc | 9e1bb2aac0837747c5d8f4b55a81dff487d66cc8 | refs/heads/master | 2021-09-14T12:18:41.499260 | 2018-05-13T15:41:51 | 2018-05-13T15:41:51 | 107,876,862 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,190 | c | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include "tools/comparison.h"
#include "tools/printing.h"
#include "tools/get_input.h"
#include "data_structures/treap.h"
void print_commands(void)
{
printf("commands: show, insert, del, inorder, preorder, postorder, fill, quit\n\n");
}
int main(void)
{
TreapNode *root = treap_init();
int nums[] = {11,12,5,67,4,44,6,8,99,21,34,19,2};
treap_load_data(&root, nums, sizeof(nums), sizeof(nums[0]), less_than_int);
char command[20];
print_commands();
while (1)
{
printf("Enter a command: ");
fgets(command, sizeof(command), stdin);
if (strncmp(command, "show", 4) == 0)
{
treap_visualise(root, 0, print_int);
}
else if (strncmp(command, "search", 6) == 0)
{
int new_int = get_int("Number to find");
if (treap_search(&root, &new_int, equal_int, less_than_int))
{
printf("found\n");
}
else
{
printf("not found\n");
}
}
else if (strncmp(command, "insert", 6) == 0)
{
int n = get_int("Number to insert");
treap_insert(&root, &n, sizeof(n), less_than_int);
}
else if (strncmp(command, "del", 3) == 0)
{
int n = get_int("Number to delete");
treap_delete_value(&root, &n, sizeof(n), equal_int, less_than_int);
}
else if (strncmp(command, "inorder", 7) == 0)
{
printf("\nin-order: ");
treap_in_order_print(root, print_int);
printf("\n\n");
}
else if (strncmp(command, "preorder", 8) == 0)
{
printf("\npre-order: ");
treap_pre_order_print(root, print_int);
printf("\n\n");
}
else if (strncmp(command, "postorder", 9) == 0)
{
printf("\npost-order: ");
treap_post_order_print(root, print_int);
printf("\n\n");
}
else if (strncmp(command, "fill", 4) == 0)
{
for (int i = 100; i < 110; i++)
{
treap_insert(&root, &i, sizeof(i), less_than_int);
}
}
else if (strncmp(command, "quit", 4) == 0)
{
treap_delete(root);
break;
}
else
{
print_commands();
continue;
}
}
}
| [
"codeactor@protonmail.com"
] | codeactor@protonmail.com |
22072eae678c0849b58b429d1e4f3fe765c5f6f3 | 4f67590fbd224791ec99f08d73d429b9d52efafc | /CUBEMX/STM32F030_I2C_DMA/Core/Src/i2c.c | ada80fce7b41fcda6a68e1f55bcc00eeb8052a91 | [] | no_license | Baopqspkt/STM32F030_TUTORIAL | 600e252f1f9cb7935502d08cef8f39562972d2ab | ee6f72e2f6582db20a8c7c8329d8c5740bd62f88 | refs/heads/master | 2023-05-13T16:01:51.877159 | 2021-06-01T17:32:40 | 2021-06-01T17:32:40 | 356,517,535 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 915 | c | /*
* i2c.c
*
* Created on: Apr 23, 2021
* Author: PC
*/
#include "i2c.h"
// Format for send data is: wdata[2]={register_addr, write_data}
void i2c_write(I2C_HandleTypeDef *hi2c,uint8_t slave_addr, uint8_t addr_register, uint8_t send_data)
{
// HAL_I2C_Master_Transmit(hi2c, slave_addr, send_data, sizeof(send_data),100);
HAL_I2C_Mem_Write(hi2c, slave_addr, addr_register, 1, &send_data, 1, 1000);
}
uint8_t i2c_read(I2C_HandleTypeDef *hi2c,uint8_t slave_addr, uint8_t register_addr)
{
uint8_t rdata;
HAL_I2C_Mem_Read(hi2c, slave_addr, register_addr, sizeof(register_addr), &rdata, sizeof(rdata), 1000);
return rdata;
}
//----------------------------- These function below use by DMA -------------------------//
void i2c_write_dma(I2C_HandleTypeDef *hi2c,uint8_t slave_addr, uint8_t addr_register, uint8_t send_data)
{
HAL_I2C_Mem_Write_DMA(hi2c, slave_addr, addr_register, 1, &send_data, 1);
}
| [
"baopq.spkt@gmail.com"
] | baopq.spkt@gmail.com |
b03c10dc7faf6c4875b4c8af713808b4c391bd49 | e22e03d9761f5c6d581b5af2e77343e8ee4b201d | /edk2/EdkCompatibilityPkg/Foundation/Core/Dxe/ArchProtocol/Cpu/Cpu.c | bddeb767dfd6f3feb1277d94a7ba3d29af1bc1c2 | [
"OpenSSL",
"BSD-2-Clause"
] | permissive | SamuelTulach/SecureFakePkg | 759975fcc84d62f05ac577da48353752e5334878 | f34080a6c0efb6ca3dd755365778d0bcdca6b991 | refs/heads/main | 2023-08-17T07:51:22.175924 | 2021-10-01T10:46:14 | 2021-10-01T10:46:14 | 410,938,306 | 94 | 14 | null | null | null | null | UTF-8 | C | false | false | 983 | c | /*++
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Cpu.c
Abstract:
CPU Architectural Protocol GUID as defined in Tiano
--*/
#include "Tiano.h"
#include EFI_ARCH_PROTOCOL_DEFINITION (Cpu)
EFI_GUID gEfiCpuArchProtocolGuid = EFI_CPU_ARCH_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiCpuArchProtocolGuid, "CPU", "CPU Arch Protocol");
| [
"samtulach@gmail.com"
] | samtulach@gmail.com |
88c2d5d72749838503f67229ef9e6404226d0005 | 976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f | /source/linux/drivers/net/ethernet/stmicro/stmmac/extr_dwmac-rk.c_rk3228_set_rgmii_speed.c | 7c0e1ca5538951579032b2d8c093f9d337dacca6 | [] | no_license | isabella232/AnghaBench | 7ba90823cf8c0dd25a803d1688500eec91d1cf4e | 9a5f60cdc907a0475090eef45e5be43392c25132 | refs/heads/master | 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,571 | c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct rk_priv_data {int /*<<< orphan*/ grf; TYPE_1__* pdev; } ;
struct device {int dummy; } ;
struct TYPE_2__ {struct device dev; } ;
/* Variables and functions */
scalar_t__ IS_ERR (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ RK3228_GMAC_CLK_125M ;
int /*<<< orphan*/ RK3228_GMAC_CLK_25M ;
int /*<<< orphan*/ RK3228_GMAC_CLK_2_5M ;
int /*<<< orphan*/ RK3228_GRF_MAC_CON1 ;
int /*<<< orphan*/ dev_err (struct device*,char*,...) ;
int /*<<< orphan*/ regmap_write (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
__attribute__((used)) static void rk3228_set_rgmii_speed(struct rk_priv_data *bsp_priv, int speed)
{
struct device *dev = &bsp_priv->pdev->dev;
if (IS_ERR(bsp_priv->grf)) {
dev_err(dev, "Missing rockchip,grf property\n");
return;
}
if (speed == 10)
regmap_write(bsp_priv->grf, RK3228_GRF_MAC_CON1,
RK3228_GMAC_CLK_2_5M);
else if (speed == 100)
regmap_write(bsp_priv->grf, RK3228_GRF_MAC_CON1,
RK3228_GMAC_CLK_25M);
else if (speed == 1000)
regmap_write(bsp_priv->grf, RK3228_GRF_MAC_CON1,
RK3228_GMAC_CLK_125M);
else
dev_err(dev, "unknown speed value for RGMII! speed=%d", speed);
} | [
"brenocfg@gmail.com"
] | brenocfg@gmail.com |
6e08a2c8c9ce9da4952d926543c499fd577f233b | 9c273d9732d7335cc75d8fee559d4c410fce7075 | /Practice 01/Aray6.4.c | 89629d136aab2491a6e05c69f7e6d414415e8f97 | [] | no_license | Md-Sanaul-Haque-Shanto/Practice-Session | 740f731ce61bc4878f5a1154cda7aa076c89b639 | 4e7173112ced64eabfc7bc0d5470b562f214f349 | refs/heads/master | 2020-03-12T11:41:32.458454 | 2018-06-10T18:13:44 | 2018-06-10T18:13:44 | 130,602,414 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 163 | c | #include<stdio.h>
main()
{int ara[10]={10,20,30,40,50,60,70,80,90,100};
int i;
for(i=0;i<100;i++)
printf("%d The Element Is:%d\n",i+1,ara[i]);
return 0;
}
| [
"mdshs.shanto@gmail.com"
] | mdshs.shanto@gmail.com |
2f4ddcb7e37cb7bacb994516ff9d09cd85c529c5 | 76cb6d156e27117d3c021aa660814a8e7b9f66f6 | /C++ Code/C study/上机课代码/2017-11-01 上机课/5.2.c | ce550cb29b4848f58e46e263f08a861edbef014a | [] | no_license | CCP101/CPP_Learning_Code | 8258023d726768cb2c7972b12562675703ce706e | ffb95854d001c85129609bf0d930aab31a02935b | refs/heads/master | 2021-04-09T14:39:21.362079 | 2020-12-11T13:14:48 | 2020-12-11T13:14:48 | 125,634,540 | 0 | 0 | null | 2018-04-30T01:32:48 | 2018-03-17T13:58:39 | C++ | UTF-8 | C | false | false | 231 | c | #include<stdio.h>
#include<math.h>
int main()
{
int n,i,count=0;
double k;
for(n=500;n<=1000;n++)
{
k=sqrt(n);
for(i=2;i<n;i++)
if(n%i==0)
break;
if(i==n)
count++;
}
printf("count=%d\n",count);
return 0;
}
| [
"liwentao0523@hotmail.com"
] | liwentao0523@hotmail.com |
9ca36a976e46b44cfcd94deb3ab9ac0831b57c68 | fe3fe968f8896b8b123bf1c0ed3351d49a779345 | /src/module.h | 4b2143c5c31fe49aebda191cd74207d89d3b39b5 | [] | no_license | oddkk/stage | c8a2d8d96bcb1681fefabe27e2980c53d9450f89 | 40324fa3eb47d14e7a3326d0169c86cd793be832 | refs/heads/master | 2022-07-09T23:13:43.861635 | 2020-08-05T16:23:53 | 2020-08-05T16:25:39 | 145,001,876 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,908 | h | #ifndef STAGE_MODULE_H
#define STAGE_MODULE_H
#include "vm.h"
#include "atom.h"
#include "objstore.h"
struct stg_module;
struct ast_module;
struct ast_node;
enum stg_module_lifetime {
STG_MOD_LIFE_PRE_COMPILE = 0,
STG_MOD_LIFE_COMPILING,
STG_MOD_LIFE_INIT,
STG_MOD_LIFE_IDLE,
STG_MOD_LIFE_RUNNING,
STG_MOD_LIFE_FAILED,
STG_MOD_LIFE_DESTROYED,
};
static inline bool
stg_mod_state_ok(enum stg_module_lifetime state) {
return
state == STG_MOD_LIFE_IDLE ||
state == STG_MOD_LIFE_RUNNING;
}
struct stg_module_native_object {
struct atom *name;
struct object obj;
};
struct stg_module {
stg_mod_id id;
enum stg_module_lifetime state;
// If a module is pinned it will not be unloaded even if no other modules
// depend on it.
bool pin;
struct atom *name;
struct string src_dir;
stg_mod_id *dependencies;
size_t num_dependencies;
struct objstore store;
struct vm *vm;
struct arena mem;
struct ast_module *ast_mod;
struct object init_monad;
struct object instance;
struct stg_native_module *native_mod;
bool has_native_module_ext;
struct string native_module_ext;
struct stg_module_native_object *native_objs;
size_t num_native_objs;
void *data;
};
struct object_decons_member {
struct atom *name;
type_id type;
bool ref;
size_t offset;
};
struct object_decons {
struct object_decons_member *members;
size_t num_members;
type_id target_type;
};
struct atom *
mod_atom(struct stg_module *, struct string name);
// Create an atom from a cstr.
#define mod_atoms(mod, str) mod_atom(mod, STR(str))
void
mod_arena(struct stg_module *mod, struct arena *out);
struct object
stg_register_object(struct stg_module *, struct object);
type_id
stg_register_type(struct stg_module *, struct type);
func_id
stg_register_func(struct stg_module *, struct func);
// The object will be copied to the module's object storage.
void
stg_mod_register_native_object(struct stg_module *,
struct atom *name, struct object);
int
stg_mod_lookup_native_object(
struct stg_module *, struct atom *name, struct object *out);
void
stg_mod_register_native_type(struct stg_module *,
struct atom *name, type_id);
void
stg_mod_register_native_cons(struct stg_module *,
struct atom *name, struct object_cons *);
int
stg_mod_lookup_member(
struct stg_module *, struct string lookup, struct object *out);
struct stg_module *
stg_mod_find_module(struct stg_module *, struct atom *name);
int
stg_mod_invoke_register(struct stg_module *mod);
int
stg_mod_invoke_pre_compile(struct ast_context *ctx,
struct stg_module *mod, struct ast_node *mod_root);
int
stg_mod_invoke_pre_init(struct stg_module *mod);
int
stg_mod_invoke_post_init(struct stg_module *mod);
int
stg_mod_invoke_start(struct stg_module *mod);
int
stg_mod_invoke_stop(struct stg_module *mod);
void
stg_mod_invoke_destroy(struct stg_module *mod);
void
stg_module_destroy(struct stg_module *mod);
#endif
| [
"okknor@gmail.com"
] | okknor@gmail.com |
3d52c71f1a5058f4943ef23884b29f7b8f5412d5 | 8f51cac89b4ee019c137cb9f753d0c008d71f6b8 | /backend/libjit/code/event.h | a2ea8d62d616c82973d453e27693212edbc33a10 | [] | no_license | fennecdjay/gwion-jit | 5c08d040e838587a52f301701228ff2146756169 | 0cfab9dcec6d3780b3ed5b53797bc758ea479f85 | refs/heads/master | 2020-04-02T00:23:32.849665 | 2018-12-14T00:46:32 | 2018-12-14T00:46:32 | 153,802,295 | 2 | 1 | null | null | null | null | UTF-8 | C | false | false | 678 | h | #include <string.h>
#include "jit/jit.h"
#include "gwjit_common.h"
#include "jitter.h"
#include "cc.h"
#include "sig.h"
#include "code.h"
#include "code/func.h"
JIT_CODE(EventWait) {
push_reg(cc, -SZ_FLOAT);
CJval obj = JLOADR(cc->reg, -SZ_INT, void_ptr);
cc_check(cc, obj, "NullEventWait");
cc_remove(cc, 0);
CJval data = JLOADR(obj, JOFF(M_Object, data), void_ptr);
CJval vec = JLOADR(data, 0, void_ptr);
jit_vector_add(cc, vec, cc->shred);
CJval one = JCONST(nint, 1);
JSTORER(cc->reg, -SZ_INT, one);
cc_release(cc, obj);
}
#define JIT_IMPORT(a) jit_code_import(j, a, jitcode_##a);
void jit_code_import_event(struct Jit* j) {
JIT_IMPORT(EventWait);
}
| [
"astor.jeremie@wanadoo.fr"
] | astor.jeremie@wanadoo.fr |
ad6e5204866a69b986ed56fa3c78241696176d87 | e649358eea83e1d7d3e5cfaf88656e9b0bc7aa5f | /modules/utilities/date/c/shared/IADate.c | 71e799ec3828ace46a0ea8a5a54ccf095929e975 | [
"MIT"
] | permissive | impsapps/impsengine | 4c23c1bd801ebd363c96d858c4d7ebb19dc19362 | 1b796bb4bccbe27b3f084a298a22c55555429aa2 | refs/heads/master | 2020-03-29T16:03:49.678574 | 2019-08-31T00:39:58 | 2019-08-31T00:39:58 | 150,095,088 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 5,109 | c | #include "IALibrary.h"
#include "IADate+Native.h"
#define CLASSNAME "IADate"
//private methods
bool IADate_isLeapYear(int year);
int IADate_getDaysOfMonth(int month, int year);
bool IADate_isCorrektDateOrder(IADate * this, IADate * date2);
void IADate_increaseMonthByOne(IADate * this);
void IADate_makeWithCurrentDate(IADate * this){
IADate_nativeMakeWithCurrentDate(this);
}
void IADate_makeWithCurrentUTCDate(IADate * this){
IADate_nativeMakeWithCurrentUTCDate(this);
}
void IADate_makeWithDayMonthYear(IADate * this, int day, int month, int year){
IADate_makeWithDayMonthYearSecondMinuteHour(this, day, month, year, 0, 0, 0);
}
void IADate_makeWithDayMonthYearSecondMinuteHour(IADate * this, int day, int month, int year, int second, int minute, int hour){
this->base = IAObject_make(this);
this->day = day;
this->month = month;
this->year = year;
this->second = second;
this->minute = minute;
this->hour = hour;
}
void IADate_makeCopy(IADate * this, const IADate * dateToCopy){
*this = *dateToCopy;
this->base = IAObject_make(this);
}
int IADate_daysDifference(IADate * this, IADate * to){
if (IADate_isCorrektDateOrder(this, to)) {
int daysDifference = 0;
IADate fromCopy;
IADate_makeCopy(&fromCopy, this);
//adjust to one year
int toYear = to->year;
fromCopy.year = toYear;
if (IADate_isCorrektDateOrder(&fromCopy, to) == false) {
toYear--;
}
fromCopy.year = this->year;
int yearToCount;
if (fromCopy.month > 2) {
yearToCount = 1;
}else{
yearToCount = 0;
}
while (fromCopy.year < toYear) {
if (IADate_isLeapYear(fromCopy.year + yearToCount)) {
daysDifference += 366;
}else{
daysDifference += 365;
}
fromCopy.year++;
}
//adjust to one month
int toMonth = to->month;
toYear = to->year;
fromCopy.month = toMonth;
int tempFromCopyYear = fromCopy.year;
fromCopy.year = to->year;
if (IADate_isCorrektDateOrder(&fromCopy, to) == false) {
toMonth--;
if (toMonth == 0) {
toMonth = 12;
toYear--;
}
}
fromCopy.month = this->month;
fromCopy.year = tempFromCopyYear;
while (fromCopy.month != toMonth || fromCopy.year != toYear) {
daysDifference += IADate_getDaysOfMonth(fromCopy.month, fromCopy.year);
IADate_increaseMonthByOne(&fromCopy);
}
//adjust exactly
int toDay = to->day;
int maxDayForMonth = IADate_getDaysOfMonth(fromCopy.month, fromCopy.year);
while (fromCopy.day != toDay) {
daysDifference++;
fromCopy.day++;
if (maxDayForMonth < fromCopy.day) {
fromCopy.day = 1;
IADate_increaseMonthByOne(&fromCopy);
maxDayForMonth = IADate_getDaysOfMonth(fromCopy.month, fromCopy.year);
}
}
return daysDifference;
}else{
return -(IADate_daysDifference(to, this));
}
}
bool IADate_isCorrektDateOrder(IADate * this, IADate * date2){
if (this->year < date2->year) {
return true;
}else if(this->year > date2->year){
return false;
}else{
if (this->month < date2->month) {
return true;
}else if(this->month > date2->month){
return false;
}else{
if (this->day <= date2->day) {
return true;
}else{
return false;
}
}
}
}
bool IADate_isLeapYear(int year){
if (year % 400 == 0) {
return true;
}else if(year % 100 == 0){
return false;
}else if(year % 4 == 0){
return true;
}else{
return false;
}
}
int IADate_getDaysOfMonth(int month, int year){
switch (month) {
case 1:
return 31;
case 2:
if (IADate_isLeapYear(year)) {
return 29;
}else{
return 28;
}
case 3:
return 31;
case 4:
return 30;
case 5:
return 31;
case 6:
return 30;
case 7:
return 31;
case 8:
return 31;
case 9:
return 30;
case 10:
return 31;
case 11:
return 30;
case 12:
return 31;
default:
assert(0 && "getDaysOfMonth: invalid month");
return 0;
}
}
void IADate_increaseMonthByOne(IADate * this){
this->month++;
if (this->month == 13) {
this->month = 1;
this->year++;
}
}
int IADate_isNextDay(IADate * this, IADate * next){
if (IADate_daysDifference(this, next) == 1) {
return true;
}else{
return false;
}
}
| [
"konstantin.merker@impsapps.com"
] | konstantin.merker@impsapps.com |
9b454ecdc33627189f2ca7de40cde030b988f42d | 2ba9f8cb53d6d846031d34298beab4cea9848a89 | /Firmwares/M058S/Library/Device/Nuvoton/M058S/Source/system_M058S.c | 25b2a9ca903a698b20b0e06b90f9c259ac0cd1b1 | [] | no_license | qq516333132/ISPTool | 4df1680b454688d4a1cbc946834e80dc77cf410e | 659d5df050acd3715818eb05026f8c5804681fef | refs/heads/master | 2020-04-26T03:07:52.745032 | 2019-02-27T01:10:08 | 2019-02-27T01:15:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,009 | c | /**************************************************************************//**
* @file system_M058S.c
* @version V2.00
* $Revision: 1 $
* $Date: 14/12/18 5:43p $
* @brief M058S Series System Setting Source File
*
* @note
* Copyright (C) 2011 Nuvoton Technology Corp. All rights reserved.
*
******************************************************************************/
#include <stdio.h>
#include <stdint.h>
#include "M058S.h"
/*----------------------------------------------------------------------------
Clock Variable definitions
*----------------------------------------------------------------------------*/
uint32_t SystemCoreClock = __HSI; /*!< System Clock Frequency (Core Clock) */
uint32_t CyclesPerUs = (__HSI / 1000000); /*!< Cycles per micro second */
uint32_t PllClock = __HSI; /*!< PLL Output Clock Frequency */
/**
* @cond HIDDEN_SYMBOLS
*/
const uint32_t gau32ClkSrcTbl[] = {__HXT, NULL, __HSI, __LIRC, NULL, NULL, NULL, __HIRC};
/**
* @endcond
*/
/**
* @brief Update the Variable SystemCoreClock
*
* @param None
*
* @return None
*
* @details This function is used to update the variable SystemCoreClock
* and must be called whenever the core clock is changed.
*/
void SystemCoreClockUpdate(void)
{
uint32_t u32Freq, u32ClkSrc;
uint32_t u32HclkDiv;
u32ClkSrc = CLK->CLKSEL0 & CLK_CLKSEL0_HCLK_S_Msk;
/* Update PLL Clock */
PllClock = CLK_GetPLLClockFreq();
if(u32ClkSrc != CLK_CLKSEL0_HCLK_S_PLL)
{
/* Use the clock sources directly */
u32Freq = gau32ClkSrcTbl[u32ClkSrc];
}
else
{
/* Use PLL clock */
u32Freq = PllClock;
}
u32HclkDiv = (CLK->CLKDIV & CLK_CLKDIV_HCLK_N_Msk) + 1;
/* Update System Core Clock */
SystemCoreClock = u32Freq / u32HclkDiv;
CyclesPerUs = (SystemCoreClock + 500000) / 1000000;
}
/**
* @brief System Initialization
*
* @param None
*
* @return None
*
* @details The necessary initialization of system. Global variables are forbidden here.
*/
void SystemInit(void)
{
#ifdef INIT_SYSCLK_AT_BOOTING
int32_t i32TimeoutCnt;
uint32_t u32HclkSelect;
int8_t i8IsPllEn;
PllClock = 0;
i8IsPllEn = 0;
u32HclkSelect = CLK->CLKSEL0 & CLK_CLKSEL0_HCLK_S_Msk;
if(u32HclkSelect == CLK_CLKSEL0_HCLK_S_HXT)
{
/* Set to 50MHz system clock frequency when clock source is from external 12MHz */
CLK->PLLCON = CLK_PLLCON_50MHz_HXT;
/* Waiting for PLL ready */
i32TimeoutCnt = (__HXT / 1000); /* Timeout is about 1ms */
while((CLK->CLKSTATUS & CLK_CLKSTATUS_PLL_STB_Msk) == 0)
{
if(i32TimeoutCnt-- <= 0)
break;
}
i8IsPllEn = 1;
}
else if(u32HclkSelect == CLK_CLKSEL0_HCLK_S_HIRC)
{
/* Set to 50.1918MHz system clock frequency when clock source is from internal 22.1184MHz RC clock */
CLK->PLLCON = CLK_PLLCON_50MHz_HIRC;
/* Waiting for PLL ready */
i32TimeoutCnt = (__HIRC / 1000); /* Timeout is about 1ms */
while((CLK->CLKSTATUS & CLK_CLKSTATUS_PLL_STB_Msk) == 0)
{
if(i32TimeoutCnt-- <= 0)
break;
}
i8IsPllEn = 1;
}
if(i8IsPllEn)
{
/* Set PLL as HCLK clock source (HCLK_S is locked setting)*/
SYS_UnlockReg();
CLK->CLKSEL0 = CLK_CLKSEL0_HCLK_S_PLL;
SYS_LockReg();
}
#endif
}
#if USE_ASSERT
/**
* @brief Assert Error Message
*
* @param[in] file the source file name
* @param[in] line line number
*
* @return None
*
* @details The function prints the source file name and line number where
* the ASSERT_PARAM() error occurs, and then stops in an infinite loop.
*/
void AssertError(uint8_t * file, uint32_t line)
{
printf("[%s] line %d : wrong parameters.\r\n", file, line);
/* Infinite loop */
while(1) ;
}
#endif
| [
"ccma@nuvoton.com"
] | ccma@nuvoton.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.